本文整理汇总了PHP中Apartment::getSublocationsOfLocation方法的典型用法代码示例。如果您正苦于以下问题:PHP Apartment::getSublocationsOfLocation方法的具体用法?PHP Apartment::getSublocationsOfLocation怎么用?PHP Apartment::getSublocationsOfLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Apartment
的用法示例。
在下文中一共展示了Apartment::getSublocationsOfLocation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
?>
<?php
echo $form->dropDownList($model, 'location_id', $locations, array('id' => 'ap_location', 'ajax' => array('type' => 'GET', 'url' => $this->createUrl('/apartments/main/getSublocations'), 'data' => 'js:"ap_location="+$("#ap_location").val()', 'success' => 'function(result){
$("#ap_sublocation").html(result);
$("#ap_sublocation").change();
}')));
?>
<?php
echo $form->error($model, 'location_id');
?>
</div>
<div class="rowold" id="sublocation_row" <?php
$valueSubLocation = Apartment::getSublocationsOfLocation($model->location_id);
if ($model->sublocation_id != 0) {
Yii::app()->clientScript->registerScript('selectSublocation', "\n \$('select[name=\\'options\\']').find('option[value=\\'" . $model->sublocation_id . "\\']').attr('selected',true);\n ");
}
?>
>
<?php
echo $form->labelEx($model, 'sublocation_id');
?>
<?php
echo $form->dropDownList($model, 'sublocation_id', $valueSubLocation, array('id' => 'ap_sublocation', 'class' => 'width240', 'ajax' => array('type' => 'GET', 'url' => $this->createUrl('/apartments/main/getRegions'), 'data' => 'js:"sublocationID="+$("#ap_sublocation").val()', 'success' => "function(result) {\n if (result!='<option value=\"0\">Выберите регион</option>')\n {\n \$('#ap_region').parent().css('display', 'block');\n \$('#ap_region').html(result);\n \$('#ap_region').change();\n\t\t\t\t\t\t }\n\t\t\t\t\t\t else\n\t\t\t\t\t\t {\n\t\t\t\t\t\t \$('#ap_region').parent().css('display', 'none');\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t}")));
?>
<?php
echo $form->error($model, 'sublocation_id');
?>