當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TbHtml::CheckBoxList方法代碼示例

本文整理匯總了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 -->
開發者ID:raphaelrocha,項目名稱:mtcontrool_mtcontext,代碼行數:31,代碼來源:_form.php

示例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 ---'));
開發者ID:raphaelrocha,項目名稱:mtcontrool_mtcontext,代碼行數:31,代碼來源:_form.php

示例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();
?>
開發者ID:raphaelrocha,項目名稱:mtcontrool_mtcontext,代碼行數:31,代碼來源:_form.php

示例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 ---'));
開發者ID:raphaelrocha,項目名稱:mtcontrool_mtcontext,代碼行數:31,代碼來源:_form_p2.php


注:本文中的TbHtml::CheckBoxList方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。