本文整理汇总了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";
}
示例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>
示例3: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$tags = $this->tagRepository->getAll();
$this->render('admin.tags.index', compact('tags'));
}
示例4: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$countries = $this->countryRepository->getAll();
$this->render('admin.countries.index', compact('countries'));
}
示例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> </option>' . "\n";
foreach ($countries as $country) {
echo '<option value="' . $country['country_code'] . '">' . $country['country'] . '</option>' . "\n";
}
echo '</select>' . "\n";
}
示例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);