当前位置: 首页>>代码示例>>PHP>>正文


PHP CHtml::activeCheckBox方法代码示例

本文整理汇总了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);
 }
开发者ID:xunicorn,项目名称:ebay-simple-watching,代码行数:17,代码来源:TbSwitch.php

示例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>';
 }
开发者ID:blindest,项目名称:Yii-CMS-2.0,代码行数:7,代码来源:IphoneCheckbox.php

示例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;')) : '');
 }
开发者ID:beckblurry,项目名称:Yii1-Base-Core-V.Alpha.1,代码行数:13,代码来源:UWfile.php

示例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');
 }
开发者ID:abudayah,项目名称:yiiwheels-custom,代码行数:14,代码来源:SwitchButton.php

示例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);
 }
开发者ID:aantonw,项目名称:dcourier.system,代码行数:11,代码来源:CFCheckBoxColumn.php

示例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);
     }
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:12,代码来源:TemplateCheckboxField.php

示例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;
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:15,代码来源:TemplateToggleButtonField.php

示例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;
 }
开发者ID:junctionaof,项目名称:thanagornfarm,代码行数:22,代码来源:TRHtml.php

示例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);
 }
开发者ID:alsvader,项目名称:hackbanero,代码行数:14,代码来源:CActiveForm.php

示例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 
开发者ID:anton-itscript,项目名称:WM-Web,代码行数:31,代码来源:exportadminssettings.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));
?>
开发者ID:qhyabdoel,项目名称:hris_mujigae,代码行数:31,代码来源:setting_form.php

示例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');
    ?>
开发者ID:hikaram,项目名称:utitheme,代码行数:31,代码来源:tab_firstline.php

示例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')) . '&nbsp;' . 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 
开发者ID:dsyman2,项目名称:X2CRM,代码行数:31,代码来源:createDropdown.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();
开发者ID:kinghinds,项目名称:kingtest2,代码行数:31,代码来源:create.php


注:本文中的CHtml::activeCheckBox方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。