本文整理汇总了PHP中Lookup::items方法的典型用法代码示例。如果您正苦于以下问题:PHP Lookup::items方法的具体用法?PHP Lookup::items怎么用?PHP Lookup::items使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lookup
的用法示例。
在下文中一共展示了Lookup::items方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testItems
public function testItems()
{
$items = Lookup::items('CrashReportStatus');
$this->assertTrue($items[1] == 'Waiting');
Lookup::reset();
$items = Lookup::items('BugStatus', Bug::STATUS_OPEN_MAX);
$this->assertTrue($items[1] == 'New');
$this->assertTrue(count($items) == 4);
}
示例2: array
<?php
$this->breadcrumbs = array('艺术家' => array('index'), '管理');
$this->menu = array(array('label' => '列出艺术家', 'url' => array('index')), array('label' => '增加艺术家', '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('artist-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>
<h1>管理艺术家</h1>
<p>
你可以在每个搜索值之前输入一个对比符 (<b><</b>, <b><=</b>, <b>></b>, <b>>=</b>, <b><></b>
或 <b>=</b>) ,以指定对比如何完成。
</p>
<?php
echo CHtml::link('高级搜索', '#', 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' => 'artist-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'summaryText' => '这是 {start} 到 {end} 共 {count} 条记录', 'columns' => array(array('name' => 'type_id', 'value' => 'ArtistType::item($data->type_id)', 'filter' => ArtistType::items()), array('name' => 'area_id', 'value' => 'ArtistArea::item($data->area_id)', 'filter' => ArtistArea::items()), array('name' => 'name', 'type' => 'raw', 'value' => 'CHtml::link(CHtml::encode($data->name), $data->url)'), array('name' => 'proved', 'value' => 'Lookup::item("PROVED",$data->proved)', 'filter' => Lookup::items('PROVED')), array('name' => 'add_time', 'type' => 'datetime', 'filter' => false), array('class' => 'CButtonColumn'))));
示例3: array
echo $item->name;
echo CHtml::closeTag("strong");
echo " - " . $item->description;
echo CHtml::closeTag("li");
}
echo CHtml::closeTag("ul");
?>
</div>
<h2><?php
echo $header2;
?>
</h2>
<?php
$foodtypes = Lookup::items('DietType');
if ($model2) {
echo CHtml::openTag("div", array('class' => 'foodmenu'));
echo CHtml::openTag("ul");
foreach ($model2 as $item2) {
echo CHtml::openTag("li");
echo CHtml::openTag("strong");
echo $item2->name;
echo CHtml::closeTag("strong");
echo " - " . $item2->description;
//echo " - ". $foodtypes[item2->foodtype];
echo CHtml::closeTag("li");
}
echo CHtml::closeTag("ul");
echo CHtml::closeTag("div");
}
示例4:
'value' => 'CHtml::link(CHtml::encode($data->username),Users::url("admin/view",array("id"=>$data->id)))',
),
array(
'name'=>'email',
'type'=>'raw',
'value'=>'CHtml::link(CHtml::encode($data->email), "mailto:".$data->email)',
),
array(
'name'=>'status',
'value'=>'User::itemAlias("UserStatus",$data->status)',
'filter'=>User::aliases('UserStatus'),
),
array(
'name'=>'role',
'type'=>'raw',
'value'=>'Lookup::item("role",$data->role)',
'filter'=>Lookup::items('role'),
),
array(
'name' => 'createtime',
'value' => 'date("d.m.Y H:i:s",$data->createtime)',
),
array(
'name' => 'lastvisit',
'value' => '($data->lastvisit?date("d.m.Y H:i:s",$data->lastvisit):Users::t("Not visited"))',
),
array(
'class'=>'CButtonColumn',
),
),
)); ?>
示例5: array
?>
<?php
$items = Lookup::items('BugPriority');
echo $form->dropDownList($model, 'priority', $items);
?>
<?php
echo $form->error($model, 'priority');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'reproducability');
?>
<?php
$items = Lookup::items('BugReproducability');
echo $form->dropDownList($model, 'reproducability', $items);
?>
<?php
echo $form->error($model, 'reproducability');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'assigned_to');
?>
<?php
$curProject = Yii::app()->user->getCurProject();
$projectUsers = $curProject->users;
$items = array();
示例6: array
<?php Y::beginTab('Настройки')?>
<?php Admin::makeTextFields($form, $model, array('title', 'second_title', 'alias'))?>
<div class="row">
<div class="left"><?php echo $form->labelEx($model,'published')?></div>
<div class="right">
<?php if ($model->isNewRecord) $model->published = Record::PUBLISHED?>
<?php echo $form->radioButtonList($model,'published',Lookup::items('FPublished'));?>
</div>
</div>
<?php Admin::makeDateFields($form, $model, 'created', 'dd.mm.yy'); ?>
<?php Y::endTab()?>
<?php Admin::makeTinyTabs($form, $model, array('text', 'descr'))?>
示例7: array
<td>
<?php
echo CHtml::activeTextField($model, "[{$index}]firstname");
?>
<?php
echo CHtml::error($model, "[{$index}]firstname");
?>
</td>
<td>
<?php
$this->widget('ext.widgets.autocomplete.XJuiAutoComplete', array('model' => $model, 'attribute' => "[{$index}]lastname", 'source' => $this->createUrl('request/suggestLastname')));
?>
<?php
echo CHtml::error($model, "[{$index}]lastname");
?>
</td>
<td>
<?php
echo CHtml::activeDropDownList($model, "[{$index}]eyecolor_code", Lookup::items('eyecolor'));
?>
<?php
echo CHtml::error($model, "[{$index}]eyecolor_code");
?>
</td>
示例8: foreach
echo Inflector::camel2id(StringHelper::basename($generator->modelClass));
?>
-form">
<?php
echo "<?php ";
?>
$form = ActiveForm::begin(); ?>
<?php
foreach ($generator->getColumnNames() as $attribute) {
if (in_array($attribute, $safeAttributes)) {
echo "\t<?= " . $generator->generateActiveField($attribute) . " ?>\n";
}
}
?>
<?php
echo $form->field($model, 'type')->dropDownList(Lookup::items('SourceType'));
?>
<?php
echo "<?php\n ";
?>
//$form->field($model, 'type')->dropDownList(Lookup::items('SourceType'))
<?php
echo "\n?>";
?>
<div class="form-group">
<?php
echo "<?= ";
?>
BaseHtml::submitButton($model->isNewRecord ? <?php
示例9: foreach
foreach ($persons as $i => $person) {
?>
<tr class="templateContent">
<td>
<?php
echo $form->textField($person, "[{$i}]firstname", array('style' => 'width:100px'));
?>
</td>
<td>
<?php
echo $form->textField($person, "[{$i}]lastname", array('style' => 'width:100px'));
?>
</td>
<td>
<?php
echo $form->dropDownList($person, "[{$i}]eyecolor_code", Lookup::items('eyecolor'), array('style' => 'width:100px', 'prompt' => ''));
?>
</td>
<td>
<input type="hidden" class="rowIndex" value="<?php
echo $i;
?>
" />
<div class="remove"><?php
echo Yii::t('ui', 'Remove');
?>
</td>
</tr>
<?php
}
?>
示例10: array
$this->breadcrumbs = array(Yii::t('ui', 'Persons'));
?>
<h2><?php
echo Yii::t('ui', 'Manage Persons');
?>
</h2>
<div class="actionBar">
<?php
echo CHtml::link(Yii::t('ui', 'New'), array('create'));
?>
</div> <!-- actionBar -->
<?php
$this->widget('zii.widgets.grid.CGridView', array('id' => 'person-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'htmlOptions' => array('style' => 'width:740px'), 'pager' => array('header' => '', 'firstPageLabel' => '<<', 'prevPageLabel' => '<', 'nextPageLabel' => '>', 'lastPageLabel' => '>>'), 'columns' => array(array('name' => 'lastname', 'type' => 'raw', 'value' => 'CHtml::link($data->lastname, $this->grid->controller->createReturnableUrl("view",array("id"=>$data->id)))'), 'firstname', 'birthyear', array('name' => 'country_id', 'value' => '$data->country->name', 'filter' => Country::model()->options), array('name' => 'eyecolor_code', 'value' => 'Lookup::item("eyecolor",$data->eyecolor_code)', 'filter' => Lookup::items('eyecolor')), array('class' => 'CLinkColumn', 'header' => Yii::t('ui', 'Email'), 'imageUrl' => XHtml::imageUrl('email.png'), 'labelExpression' => '$data->email', 'urlExpression' => '"mailto://".$data->email', 'htmlOptions' => array('style' => 'text-align:center')), array('class' => 'CButtonColumn', 'viewButtonUrl' => '$this->grid->controller->createReturnableUrl("view",array("id"=>$data->id))', 'updateButtonUrl' => '$this->grid->controller->createReturnableUrl("update",array("id"=>$data->id))', 'deleteButtonUrl' => '$this->grid->controller->createReturnableUrl("delete",array("id"=>$data->id))', 'deleteConfirmation' => Yii::t('ui', 'Are you sure to delete this item?')))));
?>
<br />
<div class="tpanel">
<div class="toggle"><?php
echo Yii::t('ui', 'View code');
?>
</div>
<?php
$this->beginWidget('CTextHighlighter', array('language' => 'PHP'));
?>
$this->widget('zii.widgets.grid.CGridView', array(
'id'=>'person-grid',
'dataProvider'=>$model->search(),
示例11: array
<?php
echo $form->error($model, 'tags');
?>
</div>
<div class="margin-left-15">
<p>Khu vực</p>
<?php
echo $form->dropDownList($model, 'status', CHtml::listData(Place::model()->findAll(), 'id', 'name'), array('class' => 'btn btn-default'));
?>
<?php
echo $form->error($model, 'status');
?>
</div>
<div class="margin-left-15">
<?php
echo CHtml::submitButton($model->isNewRecord ? 'Tạo bài đăng' : 'Lưu', array('class' => 'btn btn-default'));
?>
</div>
<?php
$this->endWidget();
?>
</div><!-- form -->
<!--<?php
echo $form->dropDownList($model, 'status', Lookup::items('PostStatus'), array('class' => 'form-control btn btn-default trangthai'));
?>
-->
示例12:
<?php
$form->endDynamicAreaDDL();
?>
<?php
$form->beginDynamicAreaDDL($model2, 'selectOption', Person::SELECT_EYECOLOR);
?>
<div class="complex">
<span class="label">
<?php
echo Yii::t('ui', 'Eyecolor');
?>
</span>
<div class="panel">
<?php
echo $form->radioButtonList($model2, 'eyecolor_code', Lookup::items('eyecolor'));
?>
<?php
echo $form->error($model2, 'eyecolor_code');
?>
</div>
</div>
<?php
$form->endDynamicAreaDDL();
?>
<?php
$this->endWidget();
?>
示例13: array
<div class="row">
<div class="left">
<?php echo $form->labelEx($model,'email'); ?>
</div>
<div class="right">
<?php echo $form->textField($model,'email',array('size'=>60,'maxlength'=>128)); ?>
<?php echo $form->error($model,'email'); ?>
</div>
</div>
<div class="row">
<div class="left">
<?php echo $form->labelEx($model,'role'); ?>
</div>
<div class="right">
<?php echo $form->dropDownList($model,'role',Lookup::items('role')); ?>
<?php echo $form->error($model,'role'); ?>
</div>
</div>
<div class="row">
<div class="left">
<?php echo $form->labelEx($model,'status'); ?>
</div>
<div class="right">
<?php echo $form->dropDownList($model,'status',User::itemAlias('UserStatus')); ?>
<?php echo $form->error($model,'status'); ?>
</div>
</div>
<?php echo $this->renderPartial('/profile/_form', array('profile'=>$profile, 'form'=>$form))?>
示例14: array
<?php
echo CHtml::activeDropDownList($model, 'eyecolor_code', Lookup::items('eyecolor'));
?>
<?php
$this->beginWidget('CTextHighlighter', array('language' => 'PHP'));
?>
echo CHtml::activeDropDownList($model,'eyecolor_code',
Lookup::add()+Lookup::items('eyecolor'),array('prompt'=>''));
<?php
$this->endWidget();
?>
<?php
echo CHtml::activeDropDownList($model, 'eyecolor_code', Lookup::add() + Lookup::items('eyecolor'), array('prompt' => ''));
?>
<h3 style="margin-top:30px"><?php
echo Yii::t('ui', 'Gridview with classificators');
?>
</h3>
<?php
$this->beginWidget('CTextHighlighter', array('language' => 'PHP'));
?>
$this->widget('zii.widgets.grid.CGridView', array(
'dataProvider'=>$model->search(),
'columns'=>array(
'firstname',
'lastname',
示例15: array
echo $form->labelEx($model, 'country_id');
?>
<?php
echo $form->DropDownList($model, 'country_id', Country::model()->options, array('prompt' => ''));
?>
<?php
echo $form->error($model, 'country_id');
?>
</div>
<div class="simple">
<?php
echo $form->labelEx($model, 'eyecolor_code');
?>
<?php
echo $form->dropDownList($model, 'eyecolor_code', Lookup::items('eyecolor'), array('prompt' => ''));
?>
<?php
echo $form->error($model, 'eyecolor_code');
?>
</div>
</div><!-- cpanelContent -->
</div><!-- cpanel -->
<div class="action">
<?php
//echo CHtml::submitButton($model->isNewRecord ? Yii::t('ui', 'Create') : Yii::t('ui','Save'));
?>
</div>