本文整理汇总了PHP中Region::getAllCities方法的典型用法代码示例。如果您正苦于以下问题:PHP Region::getAllCities方法的具体用法?PHP Region::getAllCities怎么用?PHP Region::getAllCities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Region
的用法示例。
在下文中一共展示了Region::getAllCities方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
$allCities = Region::getAllCities();
$this->renderPartial('side', $_data_);
?>
<div class="content-wrapper col-md-10 col-sm-9">
<h3 class="has-divider text-highlight">
<?php
echo Yii::t('common', 'Edit profile.');
?>
</h3>
<?php
$form = $this->beginWidget('ActiveForm', array('htmlOptions' => array('role' => 'form')));
?>
<?php
if ($user->wcaid == '') {
?>
<?php
echo Html::formGroup($model, 'wcaid', array(), $form->labelEx($model, 'wcaid'), Html::activeTextField($model, 'wcaid'), $form->error($model, 'wcaid', array('class' => 'text-danger')));
?>
<?php
}
?>
<?php
if ($user->country_id == 1) {
?>
<?php
echo Html::formGroup($model, 'province_id', array('id' => 'province'), $form->labelEx($model, 'province_id'), $form->dropDownList($model, 'province_id', Region::getProvinces(), array('class' => 'form-control', 'prompt' => '')), $form->error($model, 'province_id', array('class' => 'text-danger')));
?>
<?php
echo Html::formGroup($model, 'city_id', array('id' => 'city'), $form->labelEx($model, 'city_id'), $form->dropDownList($model, 'city_id', isset($allCities[$model->province_id]) ? $allCities[$model->province_id] : array(), array('class' => 'form-control')), $form->error($model, 'city_id', array('class' => 'text-danger')));
示例2: actionEdit
public function actionEdit()
{
$id = $this->iGet('id');
$model = User::model()->findByPk($id);
if ($model === null) {
$this->redirect(Yii::app()->request->urlReferrer);
}
if (isset($_POST['User'])) {
$model->attributes = $_POST['User'];
$model->handleDate();
if ($model->save()) {
Yii::app()->user->setFlash('success', '编辑用户成功');
$this->redirect($this->getReferrer());
}
}
$model->formatDate();
$roles = User::getRoles();
$identities = User::getIdentities();
$genders = User::getGenders();
$cities = Region::getAllCities();
$this->render('edit', array('model' => $model, 'roles' => $roles, 'identities' => $identities, 'genders' => $genders, 'cities' => $cities));
}
示例3: getCompetitionData
private function getCompetitionData($model)
{
$wcaDelegates = array();
foreach (User::getDelegates(User::IDENTITY_WCA_DELEGATE) as $delegate) {
$wcaDelegates[$delegate->id] = $delegate->name_zh ?: $delegate->name;
}
$ccaDelegates = array();
foreach (User::getDelegates(User::IDENTITY_CCA_DELEGATE) as $delegate) {
$ccaDelegates[$delegate->id] = $delegate->name_zh ?: $delegate->name;
}
$organizers = User::getOrganizers();
$types = Competition::getTypes();
$checkPersons = Competition::getCheckPersons();
$normalEvents = Events::getNormalEvents();
$otherEvents = Events::getOtherEvents();
$cities = Region::getAllCities();
return array('model' => $model, 'normalEvents' => $normalEvents, 'otherEvents' => $otherEvents, 'cities' => $cities, 'wcaDelegates' => $wcaDelegates, 'ccaDelegates' => $ccaDelegates, 'organizers' => $organizers, 'types' => $types, 'checkPersons' => $checkPersons);
}