本文整理汇总了PHP中State::items方法的典型用法代码示例。如果您正苦于以下问题:PHP State::items方法的具体用法?PHP State::items怎么用?PHP State::items使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类State
的用法示例。
在下文中一共展示了State::items方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: operator
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('city-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>
<h1>Manage Cities</h1>
<!--<p>
You may optionally enter a comparison operator (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>-->
<?php
//echo CHtml::link('Advanced Search','#',array('class'=>'search-button'));
?>
<div class="search-form" style="display:none">
<?php
$this->renderPartial('_search', array('model' => $model));
?>
</div><!-- search-form -->
<?php
$dataProvider = $model->search();
if (Yii::app()->user->getState("pageSize", @$_GET["pageSize"])) {
$pageSize = Yii::app()->user->getState("pageSize", @$_GET["pageSize"]);
} else {
$pageSize = Yii::app()->params['pageSize'];
}
$dataProvider->getPagination()->setPageSize($pageSize);
?>
<?php
$this->widget('zii.widgets.grid.CGridView', array('id' => 'city-grid', 'dataProvider' => $dataProvider, 'filter' => $model, 'columns' => array(array('header' => 'SI No', 'class' => 'IndexColumn'), 'city_name', array('name' => 'state_id', 'value' => 'State::item($data->state_id)', 'filter' => State::items()), array('name' => 'country_id', 'value' => 'Country::item($data->country_id)', 'filter' => Country::items()), array('class' => 'MyCButtonColumn')), 'pager' => array('class' => 'AjaxList', 'maxButtonCount' => $model->count(), 'header' => '')));
示例2: array
<?php $this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$model,
'summaryText'=>false,
'enableSorting'=>false,
'enablePagination' => false,
'columns'=>array(
array(
'header'=>'SI No',
'class'=>'IndexColumn',
),
'city_name',
array(
'name'=>'state_id',
'value'=>'State::model()->findByPk($data->state_id)->state_name',
'filter'=> State::items(),
),
array(
'name'=>'country_id',
'value'=>'Country::model()->findByPk($data->country_id)->name',
'filter'=> Country::items(),
),
),
)); ?>
示例3:
echo $form->labelEx($model, 'student_address_p_pin');
?>
<?php
echo $form->textField($model, 'student_address_p_pin');
?>
<?php
echo $form->error($model, 'student_address_p_pin');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'student_address_p_state');
?>
<?php
echo $form->dropDownList($model, 'student_address_p_state', State::items());
?>
<?php
echo $form->error($model, 'student_address_p_state');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'student_address_p_country');
?>
<?php
echo $form->dropDownList($model, 'student_address_p_country', Country::items());
?>
<?php
echo $form->error($model, 'student_address_p_country');
示例4:
?>
<?php
echo $form->textField($model, 'employee_address_p_pincode');
?>
<span class="status"> </span>
<?php
echo $form->error($model, 'employee_address_p_pincode');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'employee_address_p_state');
?>
<?php
echo $form->dropDownList($model, 'employee_address_p_state', State::items());
?>
<span class="status"> </span>
<?php
echo $form->error($model, 'employee_address_p_state');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'employee_address_p_country');
?>
<?php
echo $form->dropDownList($model, 'employee_address_p_country', Country::items());
?>
<span class="status"> </span>
示例5: array
<div class="operation">
<?php
echo CHtml::link('PDF', array('exportToPDFExcel/CityExportToPdf'), array('class' => 'btnyellow', 'target' => '_blank'));
echo CHtml::link('Excel', array('exportToPDFExcel/CityExportToExcel'), array('class' => 'btnblue'));
?>
</div>
<div class="portlet box blue">
<div class="portlet-title"> City
</div>
<?php
echo CHtml::link('Add New +', array('city/create'), array('class' => 'btn green'));
?>
<?php
$dataProvider = $model->search();
if (Yii::app()->user->getState("pageSize", @$_GET["pageSize"])) {
$pageSize = Yii::app()->user->getState("pageSize", @$_GET["pageSize"]);
} else {
$pageSize = Yii::app()->params['pageSize'];
}
$dataProvider->getPagination()->setPageSize($pageSize);
?>
<?php
$this->widget('zii.widgets.grid.CGridView', array('id' => 'city-grid', 'dataProvider' => $dataProvider, 'filter' => $model, 'selectionChanged' => "function(id){\n\t\twindow.location='" . Yii::app()->urlManager->createUrl('city/view', array('id' => '')) . "' + \$.fn.yiiGridView.getSelection(id);\n\t}", 'columns' => array(array('header' => 'SI No', 'class' => 'IndexColumn'), 'city_name', array('name' => 'state_id', 'value' => 'State::item($data->state_id)', 'filter' => State::items())), 'pager' => array('class' => 'AjaxList', 'maxButtonCount' => $model->count(), 'header' => '')));
?>
</div>