当前位置: 首页>>代码示例>>PHP>>正文


PHP Country::getCountriesArray方法代码示例

本文整理汇总了PHP中Country::getCountriesArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Country::getCountriesArray方法的具体用法?PHP Country::getCountriesArray怎么用?PHP Country::getCountriesArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Country的用法示例。


在下文中一共展示了Country::getCountriesArray方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

echo $form->labelEx($model, 'country_id');
?>
		<?php 
echo $form->dropDownList($model, 'country_id', Country::getCountriesArray(0, 1), array('id' => 'ap_country', 'ajax' => array('type' => 'GET', 'url' => $this->createUrl('/location/main/getRegions'), 'update' => '#ap_region', 'data' => 'js:"country="+$("#ap_country").val()+"&all=1"')));
?>
		<?php 
echo $form->error($model, 'country_id');
?>
	</div>

	<?php 
//при создании города узнаём id первой в дропдауне страны
if ($model->country_id) {
    $country = $model->country_id;
} else {
    $country_keys = array_keys(Country::getCountriesArray(0, 1));
    $country = isset($country_keys[0]) ? $country_keys[0] : 0;
}
?>
	<div class="rowold">
		<?php 
echo $form->labelEx($model, 'region_id');
?>
		<?php 
echo $form->dropDownList($model, 'region_id', Region::getRegionsArray($country, 0, 1), array('id' => 'ap_region'));
?>
		<?php 
echo $form->error($model, 'region_id');
?>
	</div>
开发者ID:barricade86,项目名称:raui,代码行数:30,代码来源:_form.php

示例2: tt

<div>
	<p><?php 
echo tt('The file is exported to the UTP-8 without BOM charset.');
?>
</p>
	<p><?php 
echo tt('Separators are ";".');
?>
</p>
</div>

<?php 
$columns = array(array('class' => 'CCheckBoxColumn', 'header' => tt('Select'), 'id' => 'itemsSelectedExport'), array('name' => 'id', 'htmlOptions' => array('class' => 'apartments_id_column', 'style' => 'text-align: center;'), 'sortable' => false), array('name' => 'active', 'type' => 'raw', 'value' => 'Yii::app()->controller->returnControllerStatusHtml($data, "apartments-grid", 1)', 'htmlOptions' => array('class' => 'apartments_status_column'), 'filter' => Apartment::getModerationStatusArray(), 'sortable' => false), array('name' => 'type', 'type' => 'raw', 'value' => 'Apartment::getNameByType($data->type)', 'htmlOptions' => array('style' => 'width: 100px;'), 'filter' => Apartment::getTypesArray(), 'sortable' => false));
if (issetModule('location')) {
    $columns[] = array('name' => 'loc_country', 'value' => '$data->loc_country ? $data->locCountry->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => Country::getCountriesArray(0, 1));
    $columns[] = array('name' => 'loc_region', 'value' => '$data->loc_region ? $data->locRegion->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => Region::getRegionsArray($model->loc_country, 0, 1));
    $columns[] = array('name' => 'loc_city', 'value' => '$data->loc_city ? $data->locCity->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => City::getCitiesArray($model->loc_region, 0, 1));
} else {
    $columns[] = array('name' => 'city_id', 'value' => '(isset($data->city ) && $data->city_id) ? $data->city->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'filter' => ApartmentCity::getAllCity(), 'sortable' => false);
}
$columns[] = array('name' => 'ownerEmail', 'htmlOptions' => array('style' => 'width: 150px;'), 'type' => 'raw', 'value' => '(isset($data->user) && $data->user->role != "admin") ? CHtml::link(CHtml::encode($data->user->email), array("/users/backend/main/view","id" => $data->user->id)) : tt("administrator", "common")');
$columns[] = array('header' => tc('Name'), 'name' => 'title_' . Yii::app()->language, 'type' => 'raw', 'value' => 'CHtml::link(CHtml::encode($data->{"title_".Yii::app()->language}), $data->getUrl())', 'sortable' => false);
?>


<div class="form">
	<?php 
$this->widget('CustomHistoryGridView', array('id' => 'export-grid', 'dataProvider' => $model->searchExport(), 'filter' => $model, 'selectableRows' => 2, 'selectionChanged' => 'js:selItemsSelected', 'columns' => $columns));
?>
开发者ID:barricade86,项目名称:raui,代码行数:29,代码来源:view_export.php

示例3: tc

</script>

<?php 
echo CHtml::label($model->getAttributeLabel('userType'), 'userType');
echo $form->dropDownList($model, 'type', CArray::merge(array(0 => tc('Please select')), User::getTypeList()), array('id' => 'userType'));
?>

<?php 
echo CHtml::label($model->getAttributeLabel('withListings'), 'withListings');
echo $form->dropDownList($model, 'withListings', CArray::merge(array('' => tc('Please select')), array(0 => tc('No'), 1 => tc('Ok'))), array('id' => 'withListings'));
?>

<?php 
if (issetModule('location')) {
    echo CHtml::label($model->getAttributeLabel('countryListing'), 'countryListing');
    echo CHtml::dropDownList('Mailing[countryListing]', isset($this->selectedCountry) ? $this->selectedCountry : '', Country::getCountriesArray(2), array('class' => 'width285 searchField', 'id' => 'countryListing', 'ajax' => array('type' => 'GET', 'url' => $this->createUrl('/location/main/getRegions'), 'data' => 'js:"country="+$("#countryListing").val()+"&type=2"', 'success' => 'function(result){
					$("#regionListing").html(result);
					$("#regionListing").change();
				}')));
    echo CHtml::label($model->getAttributeLabel('regionListing'), 'regionListing');
    echo CHtml::dropDownList('Mailing[regionListing]', isset($this->selectedRegion) ? $this->selectedRegion : '', Region::getRegionsArray(isset($this->selectedCountry) ? $this->selectedCountry : 0, 2), array('class' => 'width285 searchField', 'id' => 'regionListing', 'ajax' => array('type' => 'GET', 'url' => $this->createUrl('/location/main/getCities'), 'data' => 'js:"region="+$("#regionListing").val()+"&type=2"', 'success' => 'function(result){
					$("#cityListing").html(result);
					$("#cityListing").change();
				}')));
}
?>

<?php 
echo CHtml::label($model->getAttributeLabel('cityListing'), 'cityListing');
echo CHtml::dropDownList('Mailing[cityListing]', isset($this->selectedCity) ? $this->selectedCity : '', issetModule('location') ? City::getCitiesArray(isset($this->selectedRegion) ? $this->selectedRegion : 0, 2) : CArray::merge(array(0 => tc('select city')), ApartmentCity::getActiveCity()), array('class' => 'width285 searchField', 'id' => 'cityListing'));
?>
开发者ID:barricade86,项目名称:raui,代码行数:31,代码来源:_search.php

示例4: array

    <?php 
echo $form->labelEx($model, 'obj_type_id');
?>
    <?php 
echo $form->dropDownList($model, 'obj_type_id', Apartment::getObjTypesArray(), array('class' => 'width240', 'id' => 'obj_type'));
?>
    <?php 
echo $form->error($model, 'obj_type_id');
?>
</div>

<?php 
if (issetModule('location')) {
    ?>
    <?php 
    $countries = Country::getCountriesArray();
    ?>
    <div class="rowold">
        <?php 
    echo $form->labelEx($model, 'loc_country');
    ?>
        <?php 
    echo $form->dropDownList($model, 'loc_country', $countries, array('id' => 'ap_country', 'ajax' => array('type' => 'GET', 'url' => $this->createUrl('/location/main/getRegions'), 'data' => 'js:"country="+$("#ap_country").val()', 'success' => 'function(result){
                                $("#ap_region").html(result);
                                $("#ap_region").change();
                            }'), 'class' => 'width240'));
    ?>
        <?php 
    echo $form->error($model, 'loc_country');
    ?>
    </div>
开发者ID:barricade86,项目名称:raui,代码行数:31,代码来源:__form_general.php

示例5: tt

<div id="apartments_filter" style="display: none;" class="well">
    <h4><?php 
echo tt('Filter for listings\' list');
?>
</h4>
    <?php 
if (issetModule('location') && param('useLocation', 1)) {
    ?>
        <div class="">
            <div class=""><?php 
    echo tc('Country');
    ?>
:</div>
            <?php 
    echo CHtml::dropDownList('filter[country_id]', $this->getFilterValue('country_id'), Country::getCountriesArray(2), array('class' => 'searchField', 'id' => 'country', 'ajax' => array('type' => 'GET', 'url' => $this->createUrl('/location/main/getRegions'), 'data' => 'js:"country="+$("#country").val()+"&type=2"', 'success' => 'function(result){
							$("#region").html(result);
							$("#region").change();
						}')));
    ?>
        </div>

        <div class="">
            <div class=""><?php 
    echo tc('Region');
    ?>
:</div>
            <?php 
    echo CHtml::dropDownList('filter[region_id]', $this->getFilterValue('region_id'), Region::getRegionsArray($this->getFilterValue('country_id'), 2), array('class' => 'searchField', 'id' => 'region', 'ajax' => array('type' => 'GET', 'url' => $this->createUrl('/location/main/getCities'), 'data' => 'js:"region="+$("#region").val()+"&type=0"', 'success' => 'function(result){
							$("#ap_city").html(result);
						}')));
    ?>
开发者ID:alexjkitty,项目名称:estate,代码行数:31,代码来源:_form_apartments_filter.php

示例6: array

<?php

$this->menu = array(array('label' => tt('Add city'), 'url' => array('/location/backend/city/create')));
$this->adminTitle = tt('Manage cities');
$this->widget('CustomGridView', array('id' => 'city-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'afterAjaxUpdate' => 'function(id, data){$("a[rel=\'tooltip\']").tooltip(); $("div.tooltip-arrow").remove(); $("div.tooltip-inner").remove(); reInstallSortable(id, data);}', 'rowCssClassExpression' => '"items[]_{$data->id}"', 'columns' => array(array('class' => 'CCheckBoxColumn', 'id' => 'itemsSelected', 'selectableRows' => '2', 'htmlOptions' => array('class' => 'center')), array('name' => 'active', 'header' => tc('Status'), 'type' => 'raw', 'value' => 'Yii::app()->controller->returnStatusHtml($data, "city-grid", 1)', 'htmlOptions' => array('style' => 'width: 100px;'), 'sortable' => false, 'filter' => array('0' => tc('Inactive'), '1' => tc('Active'))), array('name' => 'country_id', 'value' => '$data->country_id ? $data->country->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => Country::getCountriesArray(0, 1)), array('name' => 'region_id', 'value' => '$data->region_id ? $data->region->name : ""', 'htmlOptions' => array('style' => 'width: 150px;'), 'sortable' => false, 'filter' => Region::getRegionsArray($model->country_id, 0, 1)), array('header' => tc('Name'), 'name' => 'name_' . Yii::app()->language, 'sortable' => false), array('class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{up}{down}{fast_up}{fast_down}{update}{delete}', 'deleteConfirmation' => tc('Are you sure you want to delete this item?'), 'htmlOptions' => array('class' => 'infopages_buttons_column', 'style' => 'width:160px;'), 'buttons' => array('up' => array('label' => tc('Move an item up'), 'imageUrl' => $url = Yii::app()->assetManager->publish(Yii::getPathOfAlias('zii.widgets.assets.gridview') . '/up.gif'), 'url' => 'Yii::app()->createUrl("/location/backend/city/move", array("id"=>$data->id, "direction" => "up", "regionid"=>$data->region_id))', 'options' => array('class' => 'infopages_arrow_image_up'), 'visible' => '($data->sorter > "' . $model->minSorter . '") && ' . intval($model->region_id), 'click' => "js: function() { ajaxMoveRequest(\$(this).attr('href'), 'city-grid'); return false;}"), 'down' => array('label' => tc('Move an item down'), 'imageUrl' => $url = Yii::app()->assetManager->publish(Yii::getPathOfAlias('zii.widgets.assets.gridview') . '/down.gif'), 'url' => 'Yii::app()->createUrl("/location/backend/city/move", array("id"=>$data->id, "direction" => "down", "regionid"=>$data->region_id))', 'options' => array('class' => 'infopages_arrow_image_down'), 'visible' => '($data->sorter < "' . $model->maxSorter . '") && ' . intval($model->region_id), 'click' => "js: function() { ajaxMoveRequest(\$(this).attr('href'), 'city-grid'); return false;}"), 'fast_up' => array('label' => tc('Move to the beginning of the list'), 'imageUrl' => Yii::app()->theme->baseUrl . '/images/default/fast_top_arrow.gif', 'url' => 'Yii::app()->createUrl("/location/backend/city/move", array("id"=>$data->id, "direction" => "fast_up", "regionid"=>$data->region_id))', 'options' => array('class' => 'infopages_arrow_image_fast_up'), 'visible' => '($data->sorter > "' . $model->minSorter . '") && ' . intval($model->region_id), 'click' => "js: function() { ajaxMoveRequest(\$(this).attr('href'), 'city-grid'); return false;}"), 'fast_down' => array('label' => tc('Move to end of list'), 'imageUrl' => Yii::app()->theme->baseUrl . '/images/default/fast_bottom_arrow.gif', 'url' => 'Yii::app()->createUrl("/location/backend/city/move", array("id"=>$data->id, "direction" => "fast_down", "regionid"=>$data->region_id))', 'options' => array('class' => 'infopages_arrow_image_fast_down'), 'visible' => '($data->sorter < "' . $model->maxSorter . '") && ' . intval($model->region_id), 'click' => "js: function() { ajaxMoveRequest(\$(this).attr('href'), 'city-grid'); return false;}"))))));
$this->renderPartial('//site/admin-select-items', array('url' => '/location/backend/city/itemsSelected', 'id' => 'city-grid', 'model' => $model, 'options' => array('activate' => Yii::t('common', 'Activate'), 'deactivate' => Yii::t('common', 'Deactivate'), 'delete' => Yii::t('common', 'Delete'))));
?>



<?php 
$csrf_token_name = Yii::app()->request->csrfTokenName;
$csrf_token = Yii::app()->request->csrfToken;
$cs = Yii::app()->getClientScript();
$cs->registerCoreScript('jquery.ui');
$str_js = "\n\t\tvar fixHelper = function(e, ui) {\n\t\t\tui.children().each(function() {\n\t\t\t\t\$(this).width(\$(this).width());\n\t\t\t});\n\t\t\treturn ui;\n\t\t};\n\n\t\tfunction reInstallSortable(id, data) {\n\t\t\tinstallSortable(\$(data).find('select[name=\"City[region_id]\"] option:selected').val());\n\t\t}\n\n\t\tfunction updateGrid() {\n\t\t\t\$.fn.yiiGridView.update('city-grid');\n\t\t}\n\n\t\tfunction installSortable(areaIdSel) {\n\t\t\tif (areaIdSel > 0) {\n\t\t\t\t\$('#city-grid table.items tbody').sortable({\n\t\t\t\t\tforcePlaceholderSize: true,\n\t\t\t\t\tforceHelperSize: true,\n\t\t\t\t\titems: 'tr',\n\t\t\t\t\tupdate : function () {\n\t\t\t\t\t\tserial = \$('#city-grid table.items tbody').sortable('serialize', {key: 'items[]', attribute: 'class'}) + '&{$csrf_token_name}={$csrf_token}&area_id=' + areaIdSel;\n\t\t\t\t\t\t\$.ajax({\n\t\t\t\t\t\t\t'url': '" . $this->createUrl('/location/backend/city/sortitems') . "',\n\t\t\t\t\t\t\t'type': 'post',\n\t\t\t\t\t\t\t'data': serial,\n\t\t\t\t\t\t\t'success': function(data){\n\t\t\t\t\t\t\t\tupdateGrid();\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t'error': function(request, status, error){\n\t\t\t\t\t\t\t\talert('We are unable to set the sort order at this time.  Please try again in a few minutes.');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\thelper: fixHelper\n\t\t\t\t}).disableSelection();\n\t\t\t}\n\t\t}\n\n\t\tinstallSortable('" . intval($model->region_id) . "');\n";
$cs->registerScript('sortable-project', $str_js);
开发者ID:barricade86,项目名称:raui,代码行数:17,代码来源:admin.php


注:本文中的Country::getCountriesArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。