本文整理汇总了PHP中CMS::getCookieCity方法的典型用法代码示例。如果您正苦于以下问题:PHP CMS::getCookieCity方法的具体用法?PHP CMS::getCookieCity怎么用?PHP CMS::getCookieCity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMS
的用法示例。
在下文中一共展示了CMS::getCookieCity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
</script>
<a href="javascript:void(0)" id="select-city" data-placement="bottom">Ваш город: <span id="current-city"><?php
echo CMS::getCookieCity();
?>
</span></a>
<div id="select-city-popover" style="display: none;">
<div class="text-center">
<p><small>Ваш город - <b><?php
echo CMS::getCookieCity();
?>
</b>,<br/>угадали?</small></p>
<span class="btn-group-sm">
<a href="javascript:void(0)" class="btn btn-primary" data-button-yes="true" onClick="setCity(this,'<?php
echo CMS::getCookieCity();
?>
');"><?php
echo Yii::t('app', 'YES');
?>
</a>
<a href="javascript:void(0)" class="btn btn-link" onClick="$('#select-city').popover('hide'); load_select_city();"><?php
echo Yii::t('app', 'NO');
?>
</a>
</span>
</div>
</div>
<script>
示例2: foreach
foreach ($countries as $country) {
?>
<div class="tab-pane" id="country<?php
echo $country->id;
?>
">
<div class="row">
<?php
foreach ($country->cities as $k => $city) {
?>
<?php
if ($k % 3 == 0) {
echo '<div class="clearfix"></div>';
}
$name = $city->capital ? '<b>' . $city->name . '</b>' : $city->name;
$class = $city->name == CMS::getCookieCity() ? 'btn-default' : 'link';
?>
<div class="col-md-4 col-sm-4 col-xs-12 city-list">
<?php
echo Html::link($name, 'javascript:void(0)', array('data-name' => $city->name, 'class' => 'btn ' . $class));
?>
</div>
<?php
}
?>
<div class="clearfix"></div>
</div>
</div>
<?php
}
?>