當前位置: 首頁>>代碼示例>>PHP>>正文


PHP BsHtml::setLabelOptionsByLayout方法代碼示例

本文整理匯總了PHP中BsHtml::setLabelOptionsByLayout方法的典型用法代碼示例。如果您正苦於以下問題:PHP BsHtml::setLabelOptionsByLayout方法的具體用法?PHP BsHtml::setLabelOptionsByLayout怎麽用?PHP BsHtml::setLabelOptionsByLayout使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在BsHtml的用法示例。


在下文中一共展示了BsHtml::setLabelOptionsByLayout方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: fileField

 public function fileField($model, $attribute, $htmlOptions = array())
 {
     $controlOptions = BsArray::popValue('controlOptions', $htmlOptions, array());
     $labelOptions = BsArray::popValue('labelOptions', $htmlOptions, array());
     $layout = $this->layout;
     $output = '';
     $output .= CHtml::activeFileField($model, $attribute, $htmlOptions);
     $attr = $model->{$attribute};
     if (!empty($attr)) {
         //Special logic for ContentTypes
         $tmpModel = $model;
         if ($model instanceof ContentType) {
             $tmpModel = $model->Content;
         }
         $output .= '<p class="file">' . CHtml::link($model->{$attribute}, array('/site/getFile', 'id' => $tmpModel->id, 'field' => $attribute, 'modelName' => get_class($tmpModel))) . '</p>';
         $output .= '<div class="checkbox">' . CHtml::checkBox($attribute . '_delete');
         $output .= CHtml::label('Delete?', $attribute . '_delete') . '</div>';
     }
     $htmlOptions['input'] = $output;
     $htmlOptions['labelOptions'] = BsHtml::setLabelOptionsByLayout($layout, $labelOptions);
     if (!empty($layout)) {
         if ($layout === BsHtml::FORM_LAYOUT_HORIZONTAL) {
             $controlClass = BsArray::popValue('class', $controlOptions, BsHtml::$formLayoutHorizontalControlClass);
             BsHtml::addCssClass($controlClass, $htmlOptions['controlOptions']);
         }
     }
     return BsHTML::activeTextFieldControlGroup($model, $attribute, $htmlOptions);
 }
開發者ID:snapfrozen,項目名稱:snapcms,代碼行數:28,代碼來源:SnapActiveForm.php

示例2: processRowOptions

 /**
  * Processes the options for a input row.
  * @param CModel $model the data model.
  * @param string $attribute the attribute name.
  * @param array $htmlOptions the options.
  * @return array the processed options.
  */
 protected function processRowOptions($model, $attribute, $options)
 {
     $errorOptions = BsArray::popValue('errorOptions', $options, array());
     $errorOptions['type'] = $this->helpType;
     $error = $this->error($model, $attribute, $errorOptions);
     // kind of a hack for ajax forms but this works for now.
     if (!empty($error) && strpos($error, 'display:none') === false) {
         $options['color'] = BsHtml::INPUT_COLOR_ERROR;
     }
     if (!$this->hideInlineErrors) {
         $options['error'] = $error;
     }
     $helpOptions = BsArray::popValue('helpOptions', $options, array());
     $helpOptions['type'] = $this->helpType;
     $labelOptions = BsArray::popValue('labelOptions', $options, array());
     $options['helpOptions'] = $helpOptions;
     $options['labelOptions'] = BsHtml::setLabelOptionsByLayout($this->layout, $labelOptions);
     $options['formLayout'] = $this->layout;
     return $options;
 }
開發者ID:KEMSolutions,項目名稱:Boukem1,代碼行數:27,代碼來源:BsActiveForm.php


注:本文中的BsHtml::setLabelOptionsByLayout方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。