当前位置: 首页>>代码示例>>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;未经允许,请勿转载。