當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。