本文整理汇总了PHP中Chtml::listData方法的典型用法代码示例。如果您正苦于以下问题:PHP Chtml::listData方法的具体用法?PHP Chtml::listData怎么用?PHP Chtml::listData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chtml
的用法示例。
在下文中一共展示了Chtml::listData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUniversityList
public function getUniversityList()
{
// $u1[]='Select university';
// $u2[0]='Select university';
$u2 = Chtml::listData(University::model()->findAll(), 'uid', 'uname');
//$u=array_merge($u1,$u2);
return $u2;
}
示例2: getListOption
/**
* @Author: ANH DUNG Mar 13, 2015
* @Todo: get list option by type
* @Param: $type
*/
public static function getListOption($type)
{
$criteria = new CDbCriteria();
$criteria->order = 't.value';
$aId = array();
if ($type == ProMasterFurnished::TYPE_NORMAL) {
$aId = ProMasterFurnished::getFurnishedNormal();
} elseif ($type == ProMasterFurnished::TYPE_INDUSTRIAL) {
$aId = ProMasterFurnished::getFurnishedIndustrial();
}
$criteria->addInCondition('t.id', $aId);
$models = self::model()->findAll($criteria);
return Chtml::listData($models, 'id', 'name');
}
示例3: array
echo $form->labelEx($model, 'observation');
?>
<?php
echo $form->textArea($model, 'observation', array('rows' => 6, 'cols' => 50));
?>
<?php
echo $form->error($model, 'observation');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($modelDiagnosticWork, 'work_id');
?>
<?php
echo $form->dropDownList($modelDiagnosticWork, 'work_id', Chtml::listData(Work::model()->findAll('active=1'), 'id', 'name'), array('prompt' => 'Seleccionar'));
?>
<?php
echo CHtml::submitButton('Agregar +', array('id' => 'agregar', 'name' => 'agregar'));
?>
<?php
echo $form->error($modelDiagnosticWork, 'work_id');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'finished');
?>
<?php
echo $form->checkBox($model, 'finished');
示例4: array
echo $form->labelEx($model, 'regionID');
?>
<?php
echo CHtml::activeDropDownList($model, 'regionID', Chtml::listData(Regions::model()->findAll(), 'regionID', 'regionName'), array('empty' => 'Select a Region'));
?>
<?php
echo $form->error($model, 'regionID');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'membershipTypeID');
?>
<?php
echo CHtml::activeDropDownList($model, 'membershipTypeID', Chtml::listData(MembershipTypes::model()->findAll(), 'membershipTypeID', 'membershipTypeName'), array('empty' => 'Select Membership Type'));
?>
<?php
echo $form->error($model, 'membershipTypeID');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'memberName');
?>
<?php
echo $form->textField($model, 'memberName', array('size' => 60, 'maxlength' => 100));
?>
<?php
echo $form->error($model, 'memberName');
示例5: array
?>
<div class="row">
<?php
echo $form->labelEx($model, 'emisor_id');
echo $emisores['descripcion'];
// $list = Chtml::listData($emisores, 'id', 'descripcion');
// echo $form->dropDownList($model,'emisor_id', $list, array('prompt'=>'Selecciona una'));
echo $form->error($model, 'emisor_id');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'receptor_id');
$list2 = Chtml::listData($receptores, 'id', 'descripcion');
echo $form->dropDownList($model, 'receptor_id', $list2, array('prompt' => 'Selecciona una'));
echo $form->error($model, 'receptor_id');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'fecha');
$this->widget('application.extensions.timepicker.EJuiDateTimePicker', array('model' => $model, 'attribute' => 'fecha', 'language' => 'es', 'value' => $model->fecha, 'options' => array('dateFormat' => 'yy-mm-dd', 'timeFormat' => 'hh:mm', 'constrainInput' => 'false', 'changeYear' => 'true', 'duration' => 'fast', 'showAnim' => 'slide', 'timeText' => 'Hora', 'hourText' => 'Horas', 'minuteText' => 'Min.')));
echo $form->error($model, 'fecha');
?>
</div>
<fieldset>
<legend>Bienes Adscritos</legend>
示例6: date
// print_r($dataProvider->getData());
?>
<div class='row' style="margin-left:20%">
<div class='span3'>
<div class="row" id="evento">
<?php
$fecha = date('Y-m-d H:i:s');
echo CHtml::label('Evento', '', array('style' => 'width:70px; display:inline-table;'));
// $modeloEvento = Evento::model()->findAll(array('condition' => 'EventoSta = "ALTA"','order'=>'EventoNom'));
$modeloEvento = Evento::model()->findAll(array('condition' => "EventoSta='ALTA' AND EventoFecFin>='{$fecha}' order by EventoNom DESC"));
//$modeloEvento = Evento::model()->findAll(array('condition'=>"EventoSta='ALTA' order by EventoNom DESC"));
// $modeloEvento2 = Evento::model()->findAll(array('condition'=>"EventoSta='ALTA' order by EventoNom DESC"));
$eventoSelected = "'" . @$_GET['EventoId'] . "'" == "" ? '' : @$_GET['EventoId'];
$list = CHtml::listData($modeloEvento, 'EventoId', 'EventoNom');
echo CHtml::dropDownList('evento_id', $eventoSelected, Chtml::listData($modeloEvento, 'EventoId', 'EventoNom'), array('ajax' => array('type' => 'POST', 'url' => CController::createUrl('funciones/cargarFuncionesDistribucion'), 'beforeSend' => 'function() {
$("#funciones_distribucion").hide();
$("#funciones_distribucion_n").hide();
$(".asignaciones").hide();
$(".asignaciones_nombre").hide();
$(".buttonsagrega").hide();
$("#distribucion_resumen").hide();
$(".resumen_nombre").hide();
$(".buttonsmodifica").hide();
$(".buttonsasignar").hide();
$("#fspin").addClass("fa fa-spinner fa-spin");
}', 'complete' => 'function() {
$("#fspin").removeClass("fa fa-spinner fa-spin");
/*$("#funcion_id option:nth-child(2)").attr("selected", "selected");
//$("#funcion_id").change();*/
$("#funciones_distribucion").show();
示例7: array
$form = $this->beginWidget('CActiveForm', array('id' => 'fbm-index-form', 'enableAjaxValidation' => false, 'enableClientValidation' => true, 'htmlOptions' => array('enctype' => 'multipart/form-data', 'name' => 'fbm', 'target' => '_blank')));
//echo $form->errorSummary($model);
/*
if ( Yii::app()->user->isAdminBm ) {
echo $form->labelEx($model,'dependencia_id');
$list = Chtml::listData($dps, 'id', 'descripcion');
echo CHtml::dropDownList('FormBm1[dependencia_id]', $model->dependencia_id, $list,
array('empty' => '(Selecciona una)'));
echo $form->error($model,'dependencia_id');
}
*/
?>
<div class="row">
<?php
echo $form->labelEx($model, 'mes_id');
$list2 = Chtml::listData($meses, 'id', 'descripcion');
echo $form->dropDownList($model, 'mes_id', $list2, array('empty' => '(Selecciona una)'));
echo $form->error($model, 'mes_id');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'anho');
echo $form->dropDownList($model, 'anho', $anhos, array('empty' => '(Selecciona una)'));
echo $form->error($model, 'anho');
?>
</div>
<?php
if ($model->cod == 1) {
示例8: array
echo $form->error($model, 'stock_number');
?>
</div>
<?php
Yii::app()->clientScript->registerCssFile(Yii::app()->baseUrl . '/css/styles.css');
Yii::app()->clientScript->registerScript('accessoriesScript', "\r\n\t\t\$('#addAccesory').click(function(){\r\n\t\t\tif(\$('#Order_accesory_id option:selected').val()){\r\n\t\t\t\t\$('#Order_accesory').append(\$('#Order_accesory_id option:selected').clone()); \r\n\t\t\t}\r\n\t\t});\r\n\t\t\$('#removeAccesory').click(function(){\r\n\t\t\t\$('#Order_accesory option:selected').remove(); \r\n\t\t});\r\n\t\t\$('#order-form').submit(function(){\r\n\t\t\t\$('#Order_accesory option').attr('selected','selected');\r\n\t\t});\r\n\t");
?>
<div class="row">
<?php
echo $form->labelEx($model, 'accesory_id');
?>
<?php
echo $form->dropDownList($model, 'accesory_id', Chtml::listData(Accesory::model()->findAll(array('condition' => 'active=1', 'order' => 'name')), 'id', 'name'), array('prompt' => 'Seleccionar'));
?>
<?php
echo CHtml::button('+', array('id' => 'addAccesory'));
?>
<?php
echo CHtml::button('-', array('id' => 'removeAccesory'));
?>
<div>
<?php
echo $form->dropDownList($model, 'accesory', CHtml::listData(Accesory::model()->findAllByPk($model->accesory), 'id', 'name'), array('multiple' => 'multiple', 'size' => '5', 'style' => 'min-width:200px;'));
?>
</div>
示例9: array
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title"><?php
echo Yii::t('web/home', 'titleBoxAddTrainee');
?>
</h4>
</div>
<!--form search-->
<div class="modal-body" >
<label class="sr-only"><?php
echo Yii::t('web/home', 'Search');
?>
</label>
<input type="text" id="trainee_username" class="form-control" placeholder="Username Or Fullname Or Email" style="width: 600px;float: left;">
<?php
echo Chtml::dropDownList('dataListCompany', 'id', Chtml::listData(WUser::model()->findAll('company is NOT NULL GROUP BY company'), "company", "company"), array('empty' => Yii::t('web/home', 'Select a Company'), 'style' => 'width:215px;float:left;margin-left:10px', 'class' => 'form-control'));
?>
<button type="button" onclick="return loadTraineeOption();" class="btn btn-success" style="margin-left: 10px; float: left;"><?php
echo Yii::t('web/home', 'Search');
?>
</button>
<div id="bodyTraineeList" style="float: left;width: 100%; margin-top: 10px;"></div>
<div class="clear"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success btn-sm" onclick="return addMutilTrainee();"><?php
echo Yii::t('web/home', 'titleBoxAddTraineeButtonAdd');
?>
</button>
<button type="button" class="btn btn-danger btn-sm" data-dismiss="modal" ><?php
echo Yii::t('web/home', 'titleBoxAddTraineeButtonClose');
示例10: array
?>
</div>
<div class="row">
<?php
echo $form->label($model, 'factura_nro');
?>
<?php
echo $form->textField($model, 'factura_nro');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'status_id');
$list7 = Chtml::listData($vars['status'], 'id', 'descripcion');
echo $form->dropDownList($model, 'status_id', $list7, array('prompt' => 'CUALQUIERA'));
?>
</div>
<div class="row">
<?php
/*
echo $form->labelEx($model,'anho_id');
$list8 = Chtml::listData($vars['anhos'], 'id', 'descripcion');
echo $form->dropDownList($model,'anho_id', $list8, array('prompt'=>'CUALQUIERA'));
*/
?>
</div>
<div class="row buttons">
示例11: getBorrower
public function getBorrower()
{
$models = Employee::model()->findAll(array("order" => "first_name"));
$list = Chtml::listData($models, 'employee_id', 'fullname');
return $list;
}
示例12: array
?>
<?php
echo CHtml::Button('Agregar +', array('id' => 'agregar', 'name' => 'agregar', 'onclick' => 'send();'));
?>
<?php
echo $form->error($modelDiagnosticWork, 'work_id');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, 'status_order_id');
?>
<?php
$statusArray = array(5, 8, 13);
echo $form->dropDownList($model, 'status_order_id', Chtml::listData(StatusOrder::model()->findAllByAttributes(array("id" => $statusArray)), 'id', 'status'), array('prompt' => 'Seleccionar'));
?>
<?php
echo $form->error($model, 'status_order_id');
?>
</div>
<div class="row buttons">
<?php
echo CHtml::submitButton('Guardar', array('id' => 'guardar', 'name' => 'guardar'));
?>
</div>
<?php
$this->endWidget();
示例13: array
?>
</div>
<div class="modal-footer">
<a data-dismiss="modal" class="btn" href="#">Cerrar</a>
</div>
</div>
<div id="myModal" class="modal hide fade">
<div class="modal-header">
<a class="close" data-dismiss="modal">×</a>
<h4>Selecciona un Evento Relecionado</h4>
</div>
<div class="modal-body" style="height: 300px;">
<?php
echo CHtml::dropDownList('eventos_relacionados', '', Chtml::listData($eventos, 'EventoId', 'EventoNom'), array('empty' => '--------------', 'style' => 'width:500px', 'class' => 'chosen'));
?>
</div>
<div class="modal-footer">
<a data-dismiss="modal" class="btn" href="#">Cerrar</a>
</div>
</div>
</div> <!---FIN de controles-->
<style>
.resultado{
}
.resultado ul.result {
width: 700px;
示例14: array
--> </div>
<?php
//if they are part of an organisation, they can only upload to their own
if (isset(Yii::app()->user->getUser()->organisation->id)) {
?>
<?php
echo $form->hiddenField($CsvFile, 'organisation_id', array('value' => Yii::app()->user->getUser()->organisation->id));
?>
<?php
} else {
?>
<div class="form-group">
<?php
$dropDownData = Chtml::listData(Organisation::model()->findAll("view_name != ''"), "id", "title");
?>
<?php
echo $form->labelEx($CsvFile, 'organisation_id', array());
?>
<?php
echo $form->dropDownList($CsvFile, 'organisation_id', $dropDownData, array('class' => 'form-control'));
?>
</div>
<?php
}
?>
<div class="form-actions">
<?php
示例15: array
?>
<h1>Desincoporar Bien #<?php
echo $model->codigo;
?>
</h1>
<div class="form">
<?php
$form = $this->beginWidget('CActiveForm', array('id' => 'bienmueble-form', 'enableClientValidation' => true, 'enableAjaxValidation' => false));
?>
<div class="row">
<?php
$list = Chtml::listData($conceptos, 'id', 'descripcion');
echo $form->labelEx($movimiento, 'concepto_id');
echo $form->dropDownList($movimiento, 'concepto_id', $list, array('prompt' => 'Selecciona una'));
echo $form->error($movimiento, 'concepto_id');
?>
</div>
<div class="row buttons">
<?php
echo CHtml::submitButton('Aceptar', array('class' => 'button green'));
?>
</div>
<?php
$this->endWidget();
?>
</div>