本文整理汇总了PHP中Country::findAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::findAll方法的具体用法?PHP Country::findAll怎么用?PHP Country::findAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Country
的用法示例。
在下文中一共展示了Country::findAll方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<? } else { ?>
<option value="<?php
echo $states->tStateID;
?>
"><?php
echo $states->tStateName;
?>
</option>
<? } ?>
<? } ?>
</select>
</dt>
<dt><label>Country *</label>
<select name="country">
<?
$country = Country::findAll();
foreach($country as $countries) {
if($shipping->fldShippingCountry == "") {
$countryVal = "US";
} else {
$countryVal = $shipping->fldShippingCountry;
}
if($countries->country_code == $countryVal) {
?>
<option value="<?php
echo $countries->country_code;
?>
" selected="selected"><?php
echo $countries->country_name;
?>
</option>
示例2: isset
<?php
$page = isset($_GET['page']) ? $_GET['page'] : 1;
if (!preg_match('/^\\d+$/', $page)) {
dispatch('core/backend/404');
exit;
}
$objects = Country::findAll();
$html = new HTML();
$html->renderOut('core/backend/html_header', array('title' => i18n(array('en' => 'Country', 'zh' => '留学国家'))), true);
$html->output('<div id="wrapper">');
$html->renderOut('core/backend/header');
$perpage = 50;
$total = Country::countAll();
$total_page = ceil($total / $perpage);
$html->renderOut('destination/backend/country_list', array('objects' => Country::findAllWithPage($page, $perpage), 'current_page' => $page, 'total_page' => $total_page, 'total' => $total, 'pager' => $html->render('core/components/pagination', array('total' => $total_page, 'page' => $page)), 'start_entry' => ($page - 1) * $perpage + 1, 'end_entry' => min(array($total, $page * $perpage))), true);
$html->output('</div>');
$html->renderOut('core/backend/html_footer');
exit;
示例3: rgb
<label class='col-sm-2 control-label' for='title'>title <span style="color: rgb(185,2,0); font-weight: bold;">*</span></label>
<div class='col-sm-10'>
<input value='<?php
echo htmlentities(str_replace('\'', '"', $object->isNew() ? isset($_POST['title']) ? strip_tags($_POST['title']) : '' : $object->getTitle()));
?>
' type='text' class='form-control' id='title' name='title' required />
</div>
</div>
<div class='hr-line-dashed'></div>
<div class='form-group'>
<label class='col-sm-2 control-label'>country_id <span style="color: rgb(185,2,0); font-weight: bold;">*</span></label>
<div class='col-sm-10'>
<select class='form-control' id='country_id' name='country_id'>
<?php
foreach (Country::findAll() as $country) {
?>
<option value='<?php
echo $country->getId();
?>
' <?php
echo $object->isNew() ? isset($_POST['country_id']) ? $_POST['country_id'] == $country->getId() ? 'selected="selected"' : '' : '' : ($object->getCountryId() == $country->getId() ? "selected='selected'" : "");
?>
><?php
echo $country->getName();
?>
</option>
<?php
}
?>
</select>
示例4: array
<?php
// get youtube video url from block
$block = Block::findByName('Youtube video');
$matches = array();
preg_match('/www.youtube.com\\/embed\\/([^\\<&]+)/', $block, $matches);
if (isset($matches[1])) {
$youtube_id = $matches[1];
} else {
preg_match('/www.youtube.com\\/watch\\?v=([^\\<&]+)/', $block, $matches);
$youtube_id = $matches[1];
}
$youtube_url = isset($youtube_id) ? "https://www.youtube.com/embed/{$youtube_id}" : 'https://www.youtube.com/embed/jiBxpdobg0E';
$html = new HTML();
$html->renderOut('site/components/html_header', array('title' => $settings['sitename'], 'body_class' => 'home page page-id-115 page-template-default has-toolbar'));
$html->output('<div id="page-container">');
//$html->renderOut('site/components/toptoolbar');
$html->renderOut('site/components/header');
$html->renderOut('site/components/slider', array('carousels' => Carousel::findAll()));
$html->renderOut('site/components/latest_news', array('youtube_url' => $youtube_url));
$html->renderOut('site/components/countries_block', array('title' => 'Apply for oversea study', 'countries' => Country::findAll()));
$html->renderOut('site/components/testimonial');
$html->renderOut('site/components/footer');
$html->output('</div>');
$html->renderOut('site/components/page_footer');
$html->renderOut('site/components/html_footer');