本文整理汇总了PHP中CHtml::activeCheckBox方法的典型用法代码示例。如果您正苦于以下问题:PHP CHtml::activeCheckBox方法的具体用法?PHP CHtml::activeCheckBox怎么用?PHP CHtml::activeCheckBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHtml
的用法示例。
在下文中一共展示了CHtml::activeCheckBox方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Widget's run function
*/
public function run()
{
list($name, $id) = $this->resolveNameID();
if ($this->hasModel()) {
if ($this->form) {
echo $this->form->checkBox($this->model, $this->attribute, $this->htmlOptions);
} else {
echo CHtml::activeCheckBox($this->model, $this->attribute, $this->htmlOptions);
}
} else {
echo CHtml::checkBox($name, $this->value, $this->htmlOptions);
}
$this->registerClientScript($id);
}
示例2: run
public function run()
{
echo '<div style="width: 35px">';
// only for fixing modal error counting width
echo CHtml::activeCheckBox($this->model, $this->attribute, $this->htmlOptions);
echo '</div>';
}
示例3: editAttribute
/**
* @param $value
* @return string
*/
public function editAttribute($model, $field, $params = array())
{
if (!isset($params['options'])) {
$params['options'] = array();
}
$options = $params['options'];
unset($params['options']);
return CHtml::activeFileField($model, $field->varname, $params) . ($model->getAttribute($field->varname) ? '<br/>' . CHtml::activeCheckBox($model, '[uwfdel]' . $field->varname, $params) . ' ' . CHtml::activeLabelEx($model, '[uwfdel]' . $field->varname, array('label' => UserModule::t('Delete file'), 'style' => 'display:inline;')) : '');
}
示例4: renderField
/**
* Renders the input field
*/
public function renderField()
{
$options = $this->buildOptions();
echo \CHtml::openTag('div', $options);
if ($this->hasModel()) {
echo \CHtml::activeCheckBox($this->model, $this->attribute, $this->options);
} else {
echo \CHtml::checkBox($this->options['name'], $this->value, $this->options);
}
echo \CHtml::closeTag('div');
}
示例5: renderDataCellContent
protected function renderDataCellContent($row, $data)
{
$model = CustomerDiscount::model()->findByAttributes(array('customer_id' => $this->customer_id, 'service_id' => $data->id));
if (!$model instanceof CustomerDiscount) {
$model = new CustomerDiscount();
}
$options = $this->checkBoxHtmlOptions;
$options['name'] = str_replace('CustomerDiscount', 'CustomerDiscount[' . $row . ']', CHtml::activeName($model, $this->forAttribute));
$options['class'] = $this->id;
echo CHtml::activeCheckBox($model, $this->forAttribute, $options);
}
示例6: getField
public function getField($widgetId, $rowGroupName = '', $rowIndex, $model, $attribute, $name, $value = '', $fieldClassName = '', $htmlOptions = array(), $hasError = false, $data = '', $params = '')
{
if ($hasError) {
$fieldClassName = $fieldClassName . ' ' . CHtml::$errorCss;
}
$htmlOptions = ClonnableFields::addClass($htmlOptions, $fieldClassName);
if (ClonnableFields::isModel($model)) {
return CHtml::activeCheckBox($model, $attribute, $htmlOptions);
} else {
return CHtml::checkBox($name, (int) $value > 0, $htmlOptions);
}
}
示例7: getField
public function getField($widgetId, $rowGroupName = '', $rowIndex, $model, $attribute, $name, $value = '', $fieldClassName = '', $htmlOptions = array(), $hasError = false, $data = '', $params = '')
{
if ($hasError) {
$fieldClassName = $fieldClassName . ' ' . CHtml::$errorCss;
}
$toggleButtonHtmlOptions = array('class' => 'toggle-button ' . $fieldClassName);
$result = CHtml::openTag('div', $toggleButtonHtmlOptions);
if (ClonnableFields::isModel($model)) {
$result .= CHtml::activeCheckBox($model, $attribute, $htmlOptions);
} else {
$result .= CHtml::checkBox($name, $value, $htmlOptions);
}
$result .= CHtml::closeTag('div');
return $result;
}
示例8: switchInput
/**
* HTML element ที่เหมาะสมเพื่อสร้าง switch input ตาม model และ field ที่ระบุ
* @param CActiveRecord $model
* @param string $fieldName
* @param array $options
* @return string
*/
public static function switchInput(CActiveRecord $model, $fieldName, $options = array())
{
$containerCss = '';
$options['class'] = 'toggle';
if ($options['inputClass']) {
$options['class'] .= " {$options['inputClass']}";
unset($options['inputClass']);
}
if ($model->hasErrors($fieldName)) {
$containerCss .= ' has-error';
$errorHelp = '<span class="help-block">' . $model->getError($fieldName) . '</span>';
}
$str = "<div class=\"form-group{$containerCss}\">" . CHtml::activeLabelEx($model, $fieldName, array('class' => 'control-label col-md-3')) . '<div class="col-md-2"><div class="make-switch">' . CHtml::activeCheckBox($model, $fieldName, $options) . "</div>{$errorHelp}</div></div>";
return $str;
}
示例9: checkBox
/**
* Renders a checkbox for a model attribute.
* This method is a wrapper of {@link CHtml::activeCheckBox}.
* Please check {@link CHtml::activeCheckBox} for detailed information
* about the parameters for this method.
* @param CModel $model the data model
* @param string $attribute the attribute
* @param array $htmlOptions additional HTML attributes.
* @return string the generated check box
*/
public function checkBox($model, $attribute, $htmlOptions = array())
{
return CHtml::activeCheckBox($model, $attribute, $htmlOptions);
}
示例10: array
</div>
<div class="field-row">
<label for="<?php
echo CHtml::modelName($element) . '_' . $side . '_description';
?>
">
<?php
echo $element->getAttributeLabel($side . '_description');
?>
:
</label>
<?php
echo CHtml::activeTextArea($element, $side . '_description', array('rows' => "2", 'class' => 'autosize clearWithEyedraw'));
?>
</div>
<div class="field-row">
<label>
<?php
echo CHtml::activeCheckBox($element, $side . '_phako', array('class' => 'clearWithEyedraw'));
?>
<?php
echo $element->getAttributeLabel($side . '_phako');
?>
</label>
</div>
<div class="field-row">
<button class="ed_report secondary small">Report</button>
<button class="ed_clear secondary small">Clear</button>
</div>
</div>
开发者ID:across-health,项目名称:OphCiExamination,代码行数:30,代码来源:form_Element_OphCiExamination_AnteriorSegment_OEEyeDraw_fields.php
示例11: array
?>
<div class="middlenarrow" style="padding-top: -100px">
<?php
echo CHtml::errorSummary($importAdminsSettings);
?>
<h1>Export settings</h1>
<?php
echo CHtml::beginForm($this->createUrl('superadmin/exportadminssettings'), 'post', array('id' => 'formexportadminssettings'));
?>
<table class="">
<tr>
<td><?php
echo CHtml::activeCheckBox($exportAdminsSettings, 'user_settings');
?>
<?php
echo CHtml::activeLabel($exportAdminsSettings, 'user_settings');
?>
</td>
</tr>
</table>
<br/><br/>
<?php
echo CHtml::hiddenField('type', 'export');
?>
<?php
echo CHtml::submitButton('Get Export');
?>
<?php
示例12: at
echo at("Enter a title to group this settings and the next ones after it in a group of settings until you close it by checking the close opened group checkbox.");
?>
</span>
<?php
echo CHtml::error($model, 'group_title');
?>
</div>
</div>
<div class="form-group">
<?php
echo CHtml::activeLabelEx($model, 'group_close', array('class' => $label_class));
?>
<div class="col-md-6 col-xs-12">
<?php
echo CHtml::activeCheckBox($model, 'group_close', array('class' => 'form-control icheckbox'));
?>
<br /><span class="subtip"><?php
echo at("If you've entered a group title for a setting you may close that opened group by checking this checkbox to close it.");
?>
</span>
<?php
echo CHtml::error($model, 'group_close');
?>
</div>
</div>
<div class="form-group">
<?php
echo CHtml::activeLabelEx($model, 'sort_ord', array('class' => $label_class));
?>
示例13:
</div>
<?php
}
?>
<?php
if ((bool) $params->is_max_layout_allowed || Yii::app()->user->username == Yii::app()->params['superAdminInfo']['username']) {
?>
<div class="form-group">
<label class="col-md-3 control-label" for="title"><?php
echo CHtml::activeLabel($params, 'is_max_layout');
?>
</label>
<div class="col-md-7">
<?php
echo CHtml::activeCheckBox($params, 'is_max_layout');
?>
</div>
</div>
<?php
}
?>
<?php
if (Yii::app()->user->username == Yii::app()->params['superAdminInfo']['username']) {
?>
<div class="form-group">
<label class="col-md-3 control-label" for="title"><?php
echo CHtml::activeLabel($params, 'filter_header_color_background');
?>
示例14: array
]</a>
<a href="javascript:void(0)"
onclick="x2.dropdownManager.moveOptionDown(this);">[<?php
echo Yii::t('admin', 'Down');
?>
]</a>
<a href="javascript:void(0)"
onclick="x2.dropdownManager.deleteOption(this);">[<?php
echo Yii::t('admin', 'Del');
?>
]</a>
</div>
<br />
</li>
<?php
echo CHtml::activeLabel($model, 'multi', array('class' => 'multi-checkbox-label')) . ' ' . CHtml::activeCheckBox($model, 'multi');
?>
</ol>
</div>
<a href="javascript:void(0)"
onclick="x2.dropdownManager.addOption();" class="add-dropdown-option">[<?php
echo Yii::t('admin', 'Add Option');
?>
]</a>
<div class="row buttons">
<br />
<?php
echo CHtml::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save'), array('class' => 'x2-button'));
?>
</div>
<?php
示例15: array
<th><?php
echo CHtml::activeLabelEx($product, 'is_recommend');
?>
</th>
<td><?php
echo CHtml::activeCheckBox($product, 'is_recommend');
?>
</td>
</tr>
<tr>
<th><?php
echo CHtml::activeLabelEx($product, 'is_released');
?>
</th>
<td><?php
echo CHtml::activeCheckBox($product, 'is_released');
?>
</td>
</tr>
</table>
<?php
$basicContent = ob_get_clean();
$i18nTabs = array();
$tabs = array();
foreach (I18nHelper::getFrontendLanguages() as $lang => $prop) {
$i18nTabs[$prop['label']] = $this->renderPartial('createI18n', array('product' => $product, 'lang' => $lang, 'prop' => $prop), true);
}
$this->widget('zii.widgets.jui.CJuiTabs', array('tabs' => array('基本资料' => $basicContent) + $i18nTabs));
?>
<?php
echo CHtml::endForm();