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


PHP BsHtml::activeCheckBox方法代码示例

本文整理汇总了PHP中BsHtml::activeCheckBox方法的典型用法代码示例。如果您正苦于以下问题:PHP BsHtml::activeCheckBox方法的具体用法?PHP BsHtml::activeCheckBox怎么用?PHP BsHtml::activeCheckBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BsHtml的用法示例。


在下文中一共展示了BsHtml::activeCheckBox方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkBox

 /**
  * Renders a checkbox for a model attribute.
  * @param CModel $model the data model.
  * @param string $attribute the attribute.
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated check box.
  * @see BsHtml::activeCheckBox
  */
 public function checkBox($model, $attribute, $htmlOptions = array())
 {
     return BsHtml::activeCheckBox($model, $attribute, $htmlOptions);
 }
开发者ID:KEMSolutions,项目名称:Boukem1,代码行数:12,代码来源:BsActiveForm.php

示例2: array

echo BsHtml::activeTextField($SPP, 'price', array('name' => 'SupplierPurchaseProducts[' . $SPP->id . '][price]'));
?>
            </div>
            <?php 
if ($SPP->Product) {
    ?>
            <div class="col-md-2">
                <?php 
    echo BsHtml::activeDateField($SPP->Product, 'customer_available_from', array('name' => 'SupplierProducts[' . $SPP->supplier_product_id . '][customer_available_from]'));
    ?>
            </div>
            <div class="col-md-2">
                <?php 
    echo BsHtml::activeDateField($SPP->Product, 'customer_available_to', array('name' => 'SupplierProducts[' . $SPP->supplier_product_id . '][customer_available_to]'));
    ?>
            </div>
            <div class="col-md-2">
                <?php 
    echo BsHtml::activeCheckBox($SPP->Product, 'available_in_shop', array('name' => 'SupplierProducts[' . $SPP->supplier_product_id . '][available_in_shop]'));
    ?>
                <button name="delete" type="submit" class="close text-danger" value="<?php 
    echo $SPP->id;
    ?>
"><span class="glyphicon glyphicon-trash"></span></button>
            </div>
            <?php 
}
?>
        </div>
    </div>
</div>
开发者ID:snapfrozen,项目名称:boxomatic,代码行数:31,代码来源:_spp_form.php

示例3: datetimeFieldControlGroup

 /**
  * Generates a control group with a text field using a juidatepicker for a model attribute.
  * @param CModel $model the data model.
  * @param string $attribute the attribute name.
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated row.
  * @see BsHtml::activeDateFieldControlGroup
  */
 public function datetimeFieldControlGroup($model, $attribute, $htmlOptions = array())
 {
     $allowEmpty = false;
     $validators = $model->getValidators($attribute);
     foreach ($validators as $validator) {
         if ($validator instanceof CDateValidator && $validator->allowEmpty === true) {
             $allowEmpty = true;
             break;
         }
     }
     //I would have liked to have used the i18n date format, but the Jui Datepicker
     //doesn't support the unicode date format
     //$dateFormat = Yii::app()->locale->getDateFormat('full');
     $htmlOptions = BsHtml::addClassName('form-control', $htmlOptions);
     $htmlOptions['displaySize'] = isset($htmlOptions['displaySize']) ? $htmlOptions['displaySize'] : 1;
     $dateWidget = $this->widget('zii.widgets.jui.CJuiDatePicker', array('name' => $attribute . '_widget', 'htmlOptions' => $htmlOptions, 'options' => array('dateFormat' => 'DD, d MM yy', 'altFormat' => 'yy-mm-dd', 'altField' => '#' . CHtml::activeId($model, $attribute), 'changeYear' => true, 'changeMonth' => true), 'value' => date('l, j F Y', strtotime($model->{$attribute}))), true);
     $hourOptions = array();
     $minuteOptions = array();
     for ($i = 0; $i < 24; $i++) {
         $val = str_pad($i, 2, "0", STR_PAD_LEFT);
         $hourOptions[$val] = $val;
     }
     for ($i = 0; $i < 60; $i += 5) {
         $val = str_pad($i, 2, "0", STR_PAD_LEFT);
         $minuteOptions[$val] = $val;
     }
     $rowHtmlOptions = $htmlOptions;
     $rowHtmlOptions['input'] = '<div class="row">';
     if ($allowEmpty) {
         $rowHtmlOptions['input'] .= '<div class="col-lg-1">' . BsHtml::activeLabel($model, $attribute . '_set', array('class' => 'control-label')) . BsHtml::activeCheckBox($model, $attribute . '_set', array('class' => 'control-label')) . '</div>';
     }
     $rowHtmlOptions['input'] .= '<div class="col-lg-4">' . BsHtml::label('Date', $attribute . '_widget', array('class' => 'control-label')) . $dateWidget . '</div><div class="col-lg-2">' . BsHtml::activeLabel($model, $attribute . '_hour', array('class' => 'control-label')) . BsHtml::activeDropDownList($model, $attribute . '_hour', $hourOptions, $htmlOptions) . '</div><div class="col-lg-2">' . BsHtml::activeLabel($model, $attribute . '_minute', array('class' => 'control-label')) . BsHtml::activeDropDownList($model, $attribute . '_minute', $minuteOptions, $htmlOptions) . '</div></div>';
     $rowHtmlOptions = $this->processRowOptions($model, $attribute, $rowHtmlOptions);
     return BsHTML::activeDateFieldControlGroup($model, $attribute, $rowHtmlOptions) . BsHTML::activeHiddenField($model, $attribute);
 }
开发者ID:snapfrozen,项目名称:snapcms,代码行数:43,代码来源:SnapActiveForm.php


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