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


PHP CActiveForm::labelEx方法代码示例

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


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

示例1: labelEx

 /**
  * @inheritDoc
  */
 public function labelEx($model, $attribute, $htmlOptions = array())
 {
     if (!$this->qualifyNames && !isset($htmlOptions['for'])) {
         $htmlOptions['for'] = \CHtml::getIdByName($attribute);
     }
     return parent::labelEx($model, $attribute, $htmlOptions);
 }
开发者ID:codemix,项目名称:restyii,代码行数:10,代码来源:ActiveForm.php

示例2: labelEx

 /**
  * Renders an HTML label for a model attribute.
  * @param CModel $parentModel the parent data model
  * @param string $attributedPath the attribute or path to related model attribute
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated label tag
  */
 public function labelEx($parentModel, $attributedPath, $htmlOptions = array())
 {
     list($model, $attribute, $htmlOptions) = self::resolveArgs($parentModel, $attributedPath, $htmlOptions);
     $htmlOptions['for'] = CHtml::getIdByName($htmlOptions['name']);
     if (!isset($htmlOptions['label']) && ($label = self::resolveLabel($parentModel, $attributedPath)) !== null) {
         $htmlOptions['label'] = $label;
     }
     return parent::labelEx($model, $attribute, $htmlOptions);
 }
开发者ID:nov072008,项目名称:yiitesting,代码行数:16,代码来源:WForm.php

示例3: formatInputField

    /**
     * Formats a set of input field that consists of label, input, and error message.
     * @param  CActiveForm $form the form
     * @param  string $type the input field method
     * @param  CModel $model the model
     * @param  string $attribute the attribute
     * @param  string $icon the icon
     * @param  array $htmlOptions the HTML option values
     * @param  array $otherOptions otherOptions
     * @return string the HTML of the set of the input field
     */
    public function formatInputField($form, $type, $model, $attribute, $icon, $htmlOptions = array(), $otherOptions = array())
    {
        return '<tr>
				<td>
					<div class="control-group attribute-' . $attribute . '">
						<i class="icon ' . $icon . '"></i> ' . $form->labelEx($model, $attribute, array('class' => 'control-label')) . '
					</div>
				</td>
				<td>
					<div class="control-group attribute-' . $attribute . '">' . @$otherOptions['beforeInput'] . (isset($otherOptions['data']) ? $form->{$type}($model, $attribute, $otherOptions['data'], $htmlOptions) : $form->{$type}($model, $attribute, $htmlOptions)) . @$otherOptions['afterInput'] . (isset($otherOptions['hint']) ? '<span class="hint">' . $otherOptions['hint'] . '</span>' : '') . $form->error($model, $attribute, array('inputContainer' => '.attribute-' . $attribute)) . '
					</div>
				</td>
			</tr>';
    }
开发者ID:ekospinach,项目名称:berkuliah,代码行数:25,代码来源:BkFormatter.php

示例4: labelEx

 /**
  * Label (Extra)
  *
  * A wrapper for CHtml::activeLabelEx(). It overrides the labelEx() method in the parent class, CActiveForm, to
  * allow for form objects to be passed as well as form models.
  *
  * @access public
  * @param CForm|CModel $formModel
  * @param string $attribute
  * @param array $htmlOptions
  * @return string
  */
 public function labelEx($formModel, $attribute, $htmlOptions = array())
 {
     if ($formModel instanceof \CForm && isset($formModel->model) && $formModel->model instanceof \CModel) {
         $formModel = $formModel->model;
     }
     return parent::labelEx($formModel, $attribute, $htmlOptions);
 }
开发者ID:mynameiszanders,项目名称:yii-forms,代码行数:19,代码来源:ActiveForm.php

示例5: labelEx

 /**
  * Renders an HTML label for a model attribute.
  * This method is a wrapper of {@link TbHtml::activeLabelEx}.
  * Please check {@link TbHtml::activeLabelEx} 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 label tag
  */
 public function labelEx($model, $attribute, $htmlOptions = array())
 {
     if ($this->type == TbHtml::FORM_HORIZONTAL) {
         $htmlOptions = TbHtml::addClassName('control-label', $htmlOptions);
     }
     return parent::labelEx($model, $attribute, $htmlOptions);
 }
开发者ID:yii-twbs,项目名称:yiistrap,代码行数:17,代码来源:TbActiveForm.php

示例6: labelEx

 public function labelEx($model, $attribute, $htmlOptions = array())
 {
     $htmlOptions = CMap::mergeArray(array('class' => 'control-label'), $htmlOptions);
     return parent::labelEx($model, $attribute, $htmlOptions);
 }
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:5,代码来源:AdminActiveForm.php

示例7: array

    <div class="hidden-form">
        <div class="field">
            <?php 
    if (!$model->isNewRecord) {
        ?>
            <?php 
        echo $form->hiddenField($model, "[{$i}]id");
        ?>
            <?php 
    }
    ?>
            <?php 
    echo $form->hiddenField($model, "[{$i}]type");
    ?>
            <?php 
    echo $form->labelEx($model, "[{$i}]text");
    ?>
            <?php 
    echo $form->textArea($model, "[{$i}]text", array("rows" => 6, "cols" => 50, 'class' => 'required'));
    ?>
            <?php 
    echo $form->error($model, "[{$i}]text");
    ?>
        </div>

        <div class="field">
            <?php 
    echo $form->labelEx($model, "[{$i}]percent");
    ?>
            <?php 
    echo $form->textField($model, "[{$i}]percent", array("size" => 10, "maxlength" => 10, 'class' => 'range(1,100)'));
开发者ID:BGCX067,项目名称:facecom-svn-to-git,代码行数:31,代码来源:_form_coupon.php

示例8: labelEx

 public function labelEx($model, $attribute, $htmlOptions = array())
 {
     return parent::labelEx($model, $attribute, $htmlOptions);
 }
开发者ID:jankichaudhari,项目名称:yii-site,代码行数:4,代码来源:AdminForm.php


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