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


PHP ActiveForm::classname方法代碼示例

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


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

示例1: initWidget

 /**
  * Initializes the detail view widget
  *
  * @throws InvalidConfigException
  */
 protected function initWidget()
 {
     /**
      * @var ActiveForm $formClass
      */
     $formClass = $this->formClass;
     if ($this->enableEditMode) {
         $activeForm = ActiveForm::classname();
         if (!is_subclass_of($formClass, $activeForm) && $formClass !== $activeForm) {
             throw new InvalidConfigException("Form class '{$formClass}' must exist and extend from '{$activeForm}'.");
         }
         $this->validateDisplay();
     }
     if ($this->bootstrap) {
         Html::addCssClass($this->options, 'table');
         if ($this->hover) {
             Html::addCssClass($this->options, 'table-hover');
         }
         if ($this->bordered) {
             Html::addCssClass($this->options, 'table-bordered');
         }
         if ($this->condensed) {
             Html::addCssClass($this->options, 'table-condensed');
         }
         $this->_childTableOptions = $this->options;
         if ($this->striped) {
             Html::addCssClass($this->options, 'table-striped');
         }
     }
     Html::addCssClass($this->_childTableOptions, 'kv-child-table');
     Html::addCssClass($this->options, 'detail-view');
     Html::addCssStyle($this->labelColOptions, "text-align:{$this->hAlign};vertical-align:{$this->vAlign};");
 }
開發者ID:rumatakira,項目名稱:yii2-detail-view,代碼行數:38,代碼來源:DetailView.php

示例2: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     if ($this->enableEditMode) {
         $formClass = $this->formClass;
         $activeForm = ActiveForm::classname();
         if (!is_subclass_of($formClass, $activeForm) && $formClass !== $activeForm) {
             throw new InvalidConfigException("Form class '{$formClass}' must exist and extend from '{$activeForm}'.");
         }
         $this->validateDisplay();
     }
     if ($this->bootstrap) {
         Html::addCssClass($this->options, 'table');
         if ($this->hover) {
             Html::addCssClass($this->options, 'table-hover');
         }
         if ($this->bordered) {
             Html::addCssClass($this->options, 'table-bordered');
         }
         if ($this->condensed) {
             Html::addCssClass($this->options, 'table-condensed');
         }
         $this->_childTableOptions = $this->options;
         if ($this->striped) {
             Html::addCssClass($this->options, 'table-striped');
         }
     }
     Html::addCssClass($this->_childTableOptions, 'kv-child-table');
     Html::addCssClass($this->options, 'detail-view');
     Html::addCssStyle($this->labelColOptions, "text-align:{$this->hAlign};vertical-align:{$this->vAlign};");
     parent::init();
     if (empty($this->container['id'])) {
         $this->container['id'] = $this->getId();
     }
     $this->initI18N(__DIR__);
     if ($this->enableEditMode) {
         $this->formOptions['fieldConfig']['template'] = "{input}\n{hint}\n{error}";
         $this->_form = $formClass::begin($this->formOptions);
     }
     Html::addCssClass($this->alertContainerOptions, 'panel-body kv-alert-container');
     $this->alertMessageSettings += ['kv-detail-error' => 'alert alert-danger', 'kv-detail-success' => 'alert alert-success', 'kv-detail-info' => 'alert alert-info', 'kv-detail-warning' => 'alert alert-warning'];
     $this->registerAssets();
 }
開發者ID:TKHS7,項目名稱:yii2-detail-view,代碼行數:45,代碼來源:DetailView.php


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