TbHtml::inlineCheckBoxList PHP Method

inlineCheckBoxList() public static method

Generates an inline check box list.
public static inlineCheckBoxList ( string $name, mixed $select, array $data, array $htmlOptions = [] ) : string
$name string name of the check box list.
$select mixed selection of the check boxes.
$data array $data value-label pairs used to generate the check box list.
$htmlOptions array additional HTML attributes.
return string the generated list.
    public static function inlineCheckBoxList($name, $select, $data, $htmlOptions = array())
    {
        $htmlOptions['inline'] = true;
        return self::checkBoxList($name, $select, $data, $htmlOptions);
    }

Usage Example

Exemplo n.º 1
0
//array que ir� receber as plataformas selecionadas
$selected_platforms = array();
//para cada plataforma, insere os id_plataforma escolhidos no array
foreach ($model->platforms as $platform) {
    array_push($selected_platforms, $platform->id);
}
?>
			
			<div>
                            	<?php 
echo TbHtml::label($model->getAttributeLabel('platforms'), 'Platforms');
?>
				
				<div class="portlet-content">
				<?php 
echo TbHtml::inlineCheckBoxList('Platforms', $selected_platforms, CHtml::listData(Platforms::model()->findAll(), 'id', 'name'), array('template' => '{input} {label}'));
?>
				<?php 
echo $form->error($model, 'platforms');
?>
				</div>
			</div>
			
			</br></br>
			<?php 
//array que ir� receber os sados selecionados
$selected_languages = array();
//para cada plataforma
foreach ($model->languages as $language) {
    array_push($selected_languages, $language->id);
}
All Usage Examples Of TbHtml::inlineCheckBoxList
TbHtml