本文整理匯總了PHP中TbHtml::CheckBoxList方法的典型用法代碼示例。如果您正苦於以下問題:PHP TbHtml::CheckBoxList方法的具體用法?PHP TbHtml::CheckBoxList怎麽用?PHP TbHtml::CheckBoxList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TbHtml
的用法示例。
在下文中一共展示了TbHtml::CheckBoxList方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: array
$selected_characteristic = array();
//para cada plataforma, insere os id_plataforma escolhidos no array
foreach ($model->characteristic as $characteristic) {
array_push($selected_characteristic, $characteristic->id);
}
?>
<div>
<?php
echo TbHtml::label($model->getAttributeLabel('characteristic'), 'Characteristic');
?>
<p class="help-block">Choose the platform's characteristics:</p>
<div class="model-char">
<div class="portlet-content">
<?php
echo TbHtml::CheckBoxList('Characteristic', $selected_characteristic, CHtml::listData(Characteristic::model()->findAll(), 'id', 'name'), array('template' => '{input} {label}'));
?>
<?php
echo $form->error($model, 'characteristic');
?>
</div>
</div>
</div>
</div>
<?php
$this->endWidget();
?>
</div><!-- form -->
示例2: foreach
//var_dump($model->platforms);
foreach ($model->devices as $device) {
array_push($selected_devices, $device->ID);
}
?>
<br/><br/>
<div>
<?php
echo TbHtml::label($model->getAttributeLabel('devices'), 'Device');
?>
<div class="portlet-content" id="divprincipal">
<?php
echo TbHtml::CheckBoxList('Devices', $selected_devices, CHtml::listData(Device::model()->findAll(), 'ID', 'DESCRIPTION'), array('template' => '{input} {label}'));
?>
<?php
echo $form->error($model, 'device');
?>
</div>
</div>
-->
</br>
<?php
//echo $form->dropDownListControlGroup($model,'ID_PLATFORM',$platformsArray, array('span'=>5, 'empty' => '--- Escolha uma plataforma ---'));
示例3: foreach
//var_dump($model->platforms);
foreach ($model->platforms as $platform) {
array_push($selected_platforms, $platform->id);
}
?>
<div>
<?php
echo TbHtml::label($model->getAttributeLabel('platforms'), 'Platforms');
?>
<div class="portlet-content">
<!--echo TbHtml::inlineCheckBoxList('Platforms',/*'', $platformsArray,*/-->
<?php
echo TbHtml::CheckBoxList('Platforms', $selected_platforms, CHtml::listData(Platforms::model()->findAll(), 'id', 'name'), array('id' => 'item', 'template' => '{input} {label}', 'onchange' => 'verificaChecks()'));
?>
<?php
echo $form->error($model, 'platforms');
?>
</div>
</div>
</br>
</div>
<?php
$this->endWidget();
?>
示例4: foreach
foreach ($model->devices as $device) {
array_push($selected_devices, $device->ID);
}
?>
<div>
<?php
echo TbHtml::label($model->getAttributeLabel('devices'), 'Device');
?>
<div class="portlet-content" id="divprincipal">
<?php
echo TbHtml::CheckBoxList('Devices', $selected_devices, $devicesArray, array('template' => '{input} {label}'));
?>
<?php
echo $form->error($model, 'device');
?>
</div>
</div>
</br>
<?php
//echo $form->dropDownListControlGroup($model,'ID_PLATFORM',$platformsArray, array('span'=>5, 'empty' => '--- Escolha uma plataforma ---'));