本文整理汇总了PHP中CHtml::activeCheckBoxList方法的典型用法代码示例。如果您正苦于以下问题:PHP CHtml::activeCheckBoxList方法的具体用法?PHP CHtml::activeCheckBoxList怎么用?PHP CHtml::activeCheckBoxList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHtml
的用法示例。
在下文中一共展示了CHtml::activeCheckBoxList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkBoxList
public function checkBoxList($model, $attribute)
{
if ($model !== null) {
return CHtml::activeCheckBoxList($model, $attribute, $this->all);
} else
return CHtml::checkBoxList($attribute, '', $this->all);
}
示例2: array
?>
</b>
<?php
echo $form->dropDownList($model, 'id_tipo_bus', CHtml::listData(Stipobus::model()->findAll(), 'id_tipo_bus', 'desc_tipo_bus'), array('empty' => '-- Seleccionar --'));
?>
<?php
echo $form->textFieldRow($model, 'carga_maxima', array('style' => 'width:100px'));
?>
<?php
echo $form->fileFieldRow($model, 'imagen', array('class' => 'span5', 'maxlength' => 500));
?>
<?php
echo $form->textAreaRow($model, 'observaciones', array('rows' => 4, 'cols' => 35, 'class' => 'span4'));
?>
<b><?php
echo $form->labelEx($model, 'configuracion');
?>
</b>
<?php
echo CHtml::activeCheckBoxList($model, 'configuracion', CHtml::listData(scodobjventasextras::model()->findAll(), 'id_cod_obj_venta_extra', 'name'));
?>
<div class="form-actions">
<?php
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => $model->isNewRecord ? 'Almacenar' : 'Actualizar'));
?>
</div>
<?php
$this->endWidget();
示例3: array
echo $form->textField($model, 'email', array('size' => 60, 'maxlength' => 100));
?>
<?php
echo $form->error($model, 'email');
?>
</div>
<div class="row">
<?php
echo $form->labelEx($model, '_selected_roles');
?>
<?php
echo CHtml::activeCheckBoxList($model, '_selected_roles', CHtml::listData($model->getActiveRoles(), 'id', 'name'), array('style' => 'float: left;
margin-right: 5px;
margin-top: 0px;'));
?>
<?php
echo $form->error($model, '_selected_roles');
?>
</div>
<div class="row" >
<?php
echo CHtml::encode($model->getAttributeLabel('active'));
?>
<?php
echo $form->checkbox($model, 'active');
?>
<?php
示例4: activeCheckBoxList
public static function activeCheckBoxList($model, $attribute, $data, $htmlOptions = array())
{
self::getJValidateInstance()->activeCheckBoxList($model, $attribute, $data, $htmlOptions);
return parent::activeCheckBoxList($model, $attribute, $data, $htmlOptions);
}
示例5: array
echo CHtml::activeCheckBoxList($propertyAmenities, 'houseAmenities', CHtml::listData(CategoryAmenities::model()->findAll('amenity_type=:amenityType', array(':amenityType' => '0')), 'id', 'amenity'));
?>
</div>
</li>
<li class="error_message"><?php
echo CHtml::error($propertyAmenities, 'houseAmenities');
?>
</li>
</ul>
<ul>
<li><span><label for="Property_description" class="required">External
Amenities <span class="required"></span></label></span> <?php
//echo CHtml::activeDropdownList($propertyAmenities,'amenity_id[]',CHtml::listData(CategoryAmenities::model()->findAll(),'id','amenity'),array('size'=>'5','multiple'=>'multiple','id'=>'amenities-multi'))
?>
<div class="multi_checkbox avg"><?php
echo CHtml::activeCheckBoxList($propertyAmenities, 'externalAmenities', CHtml::listData(CategoryAmenities::model()->findAll('amenity_type=:amenityType', array(':amenityType' => '1')), 'id', 'amenity'));
?>
</div>
</li>
<li class="error_message"><?php
echo CHtml::error($propertyAmenities, 'externalAmenities');
?>
</li>
</ul>
</fieldset>
<?php
break;
}
?>
示例6: array
echo CHtml::activeDropDownList($modelProperty, 'transaction_type_id', CHtml::listData(PropertyTransactionTypes::model()->findAll(), 'id', 'transaction_type'), array('class' => 'select_box', 'empty' => 'All'));
?>
</td>
</tr>
<tr>
<td><label>Age Of Construction</label><br />
<?php
echo CHtml::activeDropDownList($modelProperty, 'age_of_construction', CHtml::listData(PropertyAgeOfConstruction::model()->findAll(), 'id', 'age'), array('empty' => 'All', 'class' => 'select_box'));
?>
</td>
</tr>
<tr>
<td><label>Type of Ownership</label> <?php
echo CHtml::activeDropDownList($modelProperty, 'ownership_type_id', CHtml::listData(CategoryOwnershipTypes::model()->findAll(), 'id', 'ownership_type'), array('empty' => 'All', 'class' => 'select_box'));
?>
</td>
</tr>
<tr>
<td><label>Amenities</label><br />
<div class="multi_checkbox med"><?php
//$amenities = isset($_POST['amenity_id'])? $_POST['amenity_id'] : null;
echo CHtml::activeCheckBoxList($propertyAmenities, 'amenity_id', CHtml::listData(CategoryAmenities::model()->findAll(), 'id', 'amenity'), array('size' => '5', 'multiple' => 'multiple', 'id' => 'amenities-multi'));
//echo CHtml::checkBoxList('amenity_id',$amenities,CHtml::listData(CategoryAmenities::model()->findAll(),'id','amenity'),array('size'=>'5','multiple'=>'multiple','id'=>'amenities-multi'));
?>
</div>
</td>
</tr>
</table>
<?php
break;
}
示例7:
</br></br><h3>Вид</h3>
<?php
echo CHtml::activeDropDownList($form, 'inkind', $inkind);
?>
</br></br><h3>Цена (у.е.)</h3>
<p>min:<?php
echo CHtml::activeNumberField($form, 'min');
?>
</p>
<p>max:<?php
echo CHtml::activeNumberField($form, 'max');
?>
</p>
</br><h3>Производитель</h3>
<?php
echo CHtml::activeCheckBoxList($form, 'producer', $producer);
?>
</p>
<?php
echo CHtml::SubmitButton('Поиск');
?>
</div>
<?php
echo CHtml::endForm();
?>
</div>
<div id="SelectFooter"></div>
</div>
示例8: array
//// 'panel 3'=>$this->renderPartial('list',null,true),
// ),
// // additional javascript options for the accordion plugin
// 'options'=>array(
// 'animated'=>'bounceslide',
// ),
//));
?>
<h3>Suche einschränken: </h3>
<div class="adv_row">
<?php
echo CHtml::activeDropDownList($search, 'wortart', CHtml::listData(wortarten::model()->findAll(), 'bezeichnung', 'bezeichnung'), array('prompt' => 'alle Wortarten'));
?>
</div>
<div class="adv_row">
<?php
echo CHtml::activeDropDownList($search, 'kategorie', CHtml::listData(kategorien::model()->findAll(), 'bezeichnung', 'bezeichnung'), array('prompt' => 'alle Kategorien'));
?>
</div>
<!--
activeCheckBox: <?php
echo CHtml::activeCheckBox($search, 'wortart', array('value' => 'Substantiv'));
?>
<br /><br />
<?php
echo CHtml::activeCheckBoxList($search, 'wortart', CHtml::listData(wortarten::model()->findAll(), 'bezeichnung', 'bezeichnung'), array('template' => '{input}{label}', 'separator' => '<br />', 'checkAll' => 'alle Wortarten'));
?>
-->
示例9: foreach
<div class="privilege_main">
<?php
foreach ($privileges as $i => $privilege) {
?>
<div class="privilege_wide">
<h3 class="title"><?php
echo $privilege['label'];
?>
</h3>
<div class="selectbox" style="margin-bottom:5px;">
<a href="#" class="selected-all">全选</a> /
<a href="#" class="inverse">反选</a>
</div>
<div class="optionbox">
<?php
echo CHtml::activeCheckBoxList($form, 'privileges', CHtml::listData($privilege['items'], 'privilege', 'label'), array('id' => false, 'class' => 'privileges'));
?>
</div>
</div>
<?php
}
?>
</div>
</div>
<?php
echo Helper::fieldTips('权限修改后管理员需要重新登录系统方可生效');
?>
</td>
</tr>
</table>
示例10:
<div style="margin-top: -20px">
<?php
$current_url = $this->createUrl('site/msghistory');
?>
<table class="formtable left" style="margin-right: 20px;">
<tr>
<th><?php
echo CHtml::activeLabel($form, 'type');
?>
</th>
</tr>
<tr>
<td>
<?php
echo CHtml::activeCheckBoxList($form, 'types', $form->getTypes());
?>
<?php
echo CHtml::error($form, 'types');
?>
</td>
</tr>
</table>
<table class="formtable left middlecolumns" id="filterparams" >
<tr>
<th><?php
echo CHtml::activeLabel($form, 'date_from');
?>
</th>
示例11: array
?>
<div class="controls">
<?php
echo CHtml::activeTextField($signupForm, 'email', array('class' => 'input-xlarge', 'data-required' => 'ture', 'data-type' => 'email'));
echo CHtml::tag('span', array('class' => 'help-inline'), $signupForm->getError('email'));
?>
</div>
</div>
<div class="well well-smallest">
<strong>
<?php
echo Yii::t('SignUpForm', 'Product list');
?>
</strong>
</div>
<div class="row-fluid row-product-list">
<?php
echo CHtml::activeCheckBoxList($signupForm, 'products', $productOpts, array('separator' => '', 'template' => '<div class="checkbox inline span4">{input}{label}</div>'));
?>
</div>
<div class="row-fluid">
<?php
echo CHtml::submitButton(Yii::t('SignUpForm', 'Signup'), array('class' => 'btn btn-primary'));
?>
</div>
<?php
echo CHtml::endForm();
?>
</div>
</body>
</html>
示例12: checkBoxListLimited
/**
* The same as CHtml::checkBoxList, but with js handlers to limit the number
* of choices in the list
*
* @param [type] $model [description]
* @param [type] $attribute [description]
* @param [type] $data [description]
* @param array $htmlOptions [description]
* @param integer $maxLimit
* @return string checkBoxList
*/
public static function checkBoxListLimited($model, $attribute, $data, $htmlOptions = array(), $maxLimit)
{
if (isset($maxLimit) && $maxLimit > 0) {
// javascript function that performs validation of number of checkboxes clicked in a list. When number of checkboxes clicked reaches maxLimit it grays out non-clicked checkboxes. Otherwise it makes available all checkboxes in a list.
$js = <<<EOD
function checkboxClickedLimit(maxLimit){
var checkboxes = arguments[1].parentNode.parentNode.getElementsByTagName("input");
// Get number of checked checkboxes
var checkedCounter = 0;
for (var i = 0; i < checkboxes.length; i++) {
if (checkboxes[i].checked)
checkedCounter++;
}
// If limit of checked succeeded mark all other checkboxes as read only, otherwise make all checkboxes updateable
if (checkedCounter >= maxLimit) {
for (var i = 0; i < checkboxes.length; i++) {
if (!checkboxes[i].checked) {
checkboxes[i].disabled = true;
checkboxes[i].parentNode.className = "checkbox-disabled";
}
}
} else {
for (var i = 0; i < checkboxes.length; i++) {
checkboxes[i].disabled = false;
checkboxes[i].parentNode.className = "checkbox-enabled";
}
}
}
EOD;
$css = <<<EOD
.checkbox-disabled {
color: gray;
}
.checkbox-enabled {
color: #312a1e;
}
EOD;
$cs = Yii::app()->getClientScript();
$cs->registerCss('checkboxAppearance', $css);
$cs->registerScript('checkboxClickedLimit', $js, CClientScript::POS_END);
// add event to all of the checkboxes in a list
$htmlOptions['onchange'] = 'javascript:checkboxClickedLimit(' . $maxLimit . ', this);';
return CHtml::activeCheckBoxList($model, $attribute, $data, $htmlOptions);
}
}
示例13: array
<tr>
<th><?php
echo CHtml::activeLabelEx($category, 'brand_id');
?>
</th>
<td>
<div class="privilege_main">
<div class="privilege_wide">
<div class="selectbox" style="margin-bottom:5px;">
<a href="#" class="selected-all">全选</a> /
<a href="#" class="inverse">反选</a>
</div>
<div class="optionbox">
<?php
echo CHtml::activeCheckBoxList($category, 'brand_id', $brandOptions, array('class' => 'privileges'));
?>
</div>
</div>
</div>
<!-- <select name="ProductCategory[brand_id]" id="brand_id">
<option value="0">请选择</option>
<?php
foreach ($brandOptions as $key => $value) {
?>
<option value="<?php
echo $key;
?>
" <?php
if (!empty($category) && $category->brand_id == $key) {
示例14: array
CHtml::listData(Pais::model()->findAll(), 'idpais', 'descpais'),
array('prompt'=>'Select',
'class'=>'form-control input-sm')
); ?>
</div>
</div>
</fieldset>
<br/>
<fieldset>
<legend>Campo de la mecánica de interés (Puede seleccionar más de uno)</legend>
<div class="row">
<div class="col-md-4">
<?php echo CHtml::activeCheckBoxList($model,'campoint',
array(
'1'=>'Diseño mecánico',
'2'=>'Educación en ingeniería mecánica',
'3'=>'Manufactura y materiales',
'4'=>'Mecanica teórica',
'5'=>'Otras',
'6'=>'Termofluidos')); ?>
</div>
</div>
<div class="row">
<div class="col-md-8">
<?php echo CHtml::activeLabel($model,'areaespe'); ?>
<?php echo CHtml::activeTextField($model,'areaespe',
array('class'=>'form-control input-sm')) ?>
</div>
</div>
</fieldset>
<br/>
<fieldset>
示例15: array
echo $station['color'];
?>
; width:5px; height:5px; float:left; margin-left:2px; "></div>
<?php
}
}
?>
</li>
<?php
/* if (!in_array($group_key,['TemperatureWater', 'TemperatureSoil'])): ?>
<li class="head"><?php echo $group['name'] ?></li>
<?php endif;*/
?>
<?php
echo CHtml::activeCheckBoxList($form, 'sensor_feature_code[' . $group_key . ']', $group['sensor_features'], array('separator' => '', 'template' => '<li>{input} {label}</li>', 'container' => '', 'checkAll' => count($group['sensor_features']) > 1 ? 'Select All' : null));
?>
</ul>
</li>
<?php
}
?>
<li id="station-feature-attention" class="hide">Please select station(s) first</li>
</ul>
</div>
</div>
</td>
<td>
<div class="select-list">
<?php
echo CHtml::button(It::t('site_label', 'do_select'), array('id' => 'accumulation_select', 'style' => 'width: 100px; display: none;'));