当前位置: 首页>>代码示例>>PHP>>正文


PHP Country::getAll方法代码示例

本文整理汇总了PHP中Country::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::getAll方法的具体用法?PHP Country::getAll怎么用?PHP Country::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Country的用法示例。


在下文中一共展示了Country::getAll方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: generateCountries

 private function generateCountries($selected = '')
 {
     $countries = Country::getAll();
     echo '<select class="field" id="country" name="country">' . "\n";
     if ($selected == '') {
         echo '<option value="0" selected>Please select a country</option>' . "\n";
     }
     foreach ($countries as $country) {
         if ($country['country_code'] != $selected) {
             echo '<option value="' . $country['country_code'] . '">' . $country['country'] . '</option>' . "\n";
         } else {
             echo '<option value="' . $country['country_code'] . '" selected>' . $country['country'] . '</option>' . "\n";
         }
     }
     echo '</select>' . "\n";
 }
开发者ID:pamalite,项目名称:yel,代码行数:16,代码来源:member_candidates_page.php

示例2: Country

                        </div>
                        <div class="box-content">

                            <form action="#" method="POST">
                                <table style="margin-left: 20%;" width="100%" >
                                    <tr>
                                        <td><label class="control-label" for="selectError">Country</label></td>
                                        <td>
                                            <div class="input-group" style="width: 50%">
                                                <span class="input-group-addon"></span>

                                                <select required="" name="country_id"  class="form-control">
                                                    <option value="">--Select Country--</option>
                                                    <?php 
$countryObj = new Country();
$rows = $countryObj->getAll();
foreach ($rows as $row) {
    ?>
                                                        <option value="<?php 
    echo $row['id'];
    ?>
"><?php 
    echo $row['name'];
    ?>
 </option>
                                                    <?php 
}
?>
                                                </select>
                                            </div>
                                        </td>
开发者ID:sonaljain888,项目名称:legal-lawyer1,代码行数:31,代码来源:add_state.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $tags = $this->tagRepository->getAll();
     $this->render('admin.tags.index', compact('tags'));
 }
开发者ID:christiannwamba,项目名称:laravel-site,代码行数:10,代码来源:AdminTagsController.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $countries = $this->countryRepository->getAll();
     $this->render('admin.countries.index', compact('countries'));
 }
开发者ID:christiannwamba,项目名称:laravel-site,代码行数:10,代码来源:AdminCountriesController.php

示例5: generateCountriesDropdown

 private function generateCountriesDropdown($_for_quick_upload = false, $_for_referrer = false)
 {
     $countries = Country::getAll();
     $prefix = $_for_quick_upload ? 'qu' : 'qr';
     $prefix .= $_for_referrer ? '_referrer' : '_candidate';
     echo '<select class="mini_field" id="' . $prefix . '_country" name="' . $prefix . '_country">' . "\n";
     echo '<option value="0" selected>Country of residence</option>' . "\n";
     echo '<option value="0" disabled>&nbsp;</option>' . "\n";
     foreach ($countries as $country) {
         echo '<option value="' . $country['country_code'] . '">' . $country['country'] . '</option>' . "\n";
     }
     echo '</select>' . "\n";
 }
开发者ID:pamalite,项目名称:yel,代码行数:13,代码来源:job_page.php

示例6: dirname

<?php

require_once dirname(__FILE__) . "/../../private/lib/utilities.php";
header('Content-type: text/xml');
$xml_dom = new XMLDOM();
$response = array();
$result = Country::getAll();
$i = 0;
foreach ($result as $row) {
    $response[$i]['country_code'] = $row['country_code'];
    $response[$i]['name'] = $row['country'];
    $i++;
}
$xml_array = array('countries' => array('country' => $response));
echo $xml_dom->get_xml_from_array($xml_array);
开发者ID:pamalite,项目名称:yel,代码行数:15,代码来源:countries_all.php


注:本文中的Country::getAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。