本文整理汇总了PHP中Roles::loadItems方法的典型用法代码示例。如果您正苦于以下问题:PHP Roles::loadItems方法的具体用法?PHP Roles::loadItems怎么用?PHP Roles::loadItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Roles
的用法示例。
在下文中一共展示了Roles::loadItems方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
$this->breadcrumbs = array('Roles Menuses' => array('index'), 'Manage');
$this->menu = array(array('label' => 'List RolesMenus', 'url' => array('index')), array('label' => 'Create RolesMenus', 'url' => array('create')));
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('roles-menus-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>
<h1>Manage Roles Menuses</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
$this->widget('zii.widgets.grid.CGridView', array('id' => 'roles-menus-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('name' => 'role_id', 'value' => '$data->role->role_name', 'filter' => Roles::loadItems()), array('name' => 'menu_id', 'value' => '$data->menu->menu_name', 'filter' => ''), array('class' => 'CButtonColumn'))));
示例2: array
<?php
$form = $this->beginWidget('CActiveForm', array('id' => 'roles-menus-form', 'enableAjaxValidation' => false));
?>
<p class="note">Fields with <span class="required">*</span> are required.</p>
<?php
echo $form->errorSummary($model);
?>
<div class="row">
<?php
echo $form->labelEx($model, 'role_id');
?>
<?php
echo $form->dropDownList($model, 'role_id', Roles::loadItems());
?>
<?php
echo $form->error($model, 'role_id');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'menu_id');
?>
<?php
echo Menus::getDropDownList('RolesMenus[menu_id]', 'RolesMenus_menu_id', $model->menu_id, true);
?>
<?php
echo $form->error($model, 'menu_id');