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


PHP ActiveForm::init方法代码示例

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


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

示例1: init

 public function init()
 {
     $this->id = $this->model->formName();
     $this->action = RequestModule::getPopupUrl(['type' => $this->model->tableName()]);
     $this->fieldConfig = ['template' => '<div class="row">{input}{error}</div>', 'errorOptions' => ['class' => 'errorMessage']];
     parent::init();
 }
开发者ID:tolik505,项目名称:bl,代码行数:7,代码来源:CustomForm.php

示例2: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     if (!in_array($this->layout, ['default', 'horizontal', 'stacked'])) {
         throw new InvalidConfigException('Invalid layout type: ' . $this->layout);
     }
     Html::addCssClass($this->options, 'uk-form');
     if ($this->layout !== 'default') {
         Html::addCssClass($this->options, 'uk-form-' . $this->layout);
     }
     if ($this->field_size) {
         if (!in_array($this->field_size, ['large', 'small'])) {
             throw new InvalidConfigException('Invalid size: ' . $this->layout . '. It must be large or small');
         }
         Html::addCssClass($this->inputOptions, 'uk-form-' . $this->field_size);
     }
     if ($this->field_size) {
         if (!in_array($this->field_size, ['large', 'small'])) {
             throw new InvalidConfigException('Invalid size: ' . $this->layout . '. It must be large & small');
         } else {
             Html::addCssClass($this->inputOptions, 'uk-form-' . $this->field_size);
         }
     }
     if ($this->field_width) {
         if (!in_array($this->field_width, ['full', 'large', 'medium', 'small', 'mini'])) {
             throw new InvalidConfigException('Invalid width: ' . $this->field_width . '. It must be full, large, medium, small or mini');
         } else {
             Html::addCssClass($this->inputOptions, $this->field_width != 'full' ? 'uk-form-width-' . $this->field_width : 'uk-width-1-1');
         }
     }
     if (isset($this->inputOptions['class'])) {
         $this->fieldConfig['inputOptions'] = ['class' => $this->inputOptions['class']];
     }
     parent::init();
 }
开发者ID:worstinme,项目名称:yii2-uikit,代码行数:37,代码来源:ActiveForm.php

示例3: init

 public function init()
 {
     if ($this->full) {
         echo $this->prepend;
     }
     parent::init();
 }
开发者ID:nagser,项目名称:base,代码行数:7,代码来源:ActiveForm.php

示例4: init

 public function init()
 {
     if (!isset($this->fieldConfig['class'])) {
         $this->fieldConfig['class'] = ActiveField::className();
     }
     parent::init();
 }
开发者ID:dw250100785,项目名称:lulucms,代码行数:7,代码来源:ActiveForm.php

示例5: init

 public function init()
 {
     if (!isset($this->fieldConfig['class'])) {
         $this->fieldConfig['class'] = ActiveField::className();
     }
     Html::addCssClass($this->options, static::$_configuration[$this->type]['class']);
     parent::init();
 }
开发者ID:omnilight,项目名称:yz2,代码行数:8,代码来源:ActiveForm.php

示例6: init

 public function init()
 {
     ActiveFormAsset::register($this->getView());
     parent::init();
     echo '<div class="panel panel-default panel-form">';
     if ($this->title) {
         echo '<div class="panel-heading">' . $this->title . '</div>';
     }
     echo '<div class="panel-body">';
 }
开发者ID:vfokov,项目名称:tims2,代码行数:10,代码来源:ActiveForm.php

示例7: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     if (!in_array($this->layout, ['default', 'inline'])) {
         throw new InvalidConfigException('Invalid layout type: ' . $this->layout);
     }
     if ($this->layout !== 'default') {
         Html::addCssClass($this->options, 'form-' . $this->layout);
     }
     parent::init();
 }
开发者ID:am1rb,项目名称:yii2-foundation,代码行数:13,代码来源:ActiveForm.php

示例8: init

 /**
  * Renders the widget.
  */
 public function init()
 {
     $this->getView()->registerJs(file_get_contents(Yii::getAlias('@vendor/anli/yii2-helper/js/modal-active-form.js')));
     $this->getView()->registerJs(file_get_contents(Yii::getAlias('@vendor/anli/yii2-helper/js/modal-hint.js')));
     $this->getView()->registerCss(file_get_contents(Yii::getAlias('@vendor/anli/yii2-helper/css/hint.css')));
     $this->getView()->registerCss(file_get_contents(Yii::getAlias('@vendor/anli/yii2-helper/css/select2.css')));
     $this->options = ['class' => 'modal-form', 'data-modal-id' => $this->modalId, 'data-select-id' => $this->selectId];
     $this->enableClientValidation = true;
     parent::init();
 }
开发者ID:anli,项目名称:yii2-helper,代码行数:13,代码来源:ModalActiveForm.php

示例9: init

 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $id = $this->options['id'];
     $clientSideKey = Yii::$app->get('braintree')->clientSideKey;
     $view = $this->getView();
     BraintreeAsset::register($view);
     $view->registerJs("braintree.setup('{$clientSideKey}', 'custom', {id: '{$id}'});");
     $this->fieldClass = ActiveField::className();
 }
开发者ID:skamnev,项目名称:members,代码行数:13,代码来源:ActiveForm.php

示例10: init

 public function init()
 {
     if ($this->size) {
         Html::addCssClass($this->options, $this->size);
     }
     if ($this->inverted === true) {
         Html::addCssClass($this->options, 'inverted');
     }
     parent::init();
 }
开发者ID:he11d0g,项目名称:yii2-semantic-ui,代码行数:10,代码来源:ActiveForm.php

示例11: init

 public function init()
 {
     if (!in_array($this->size, $this->getSizes(), true)) {
         throw new InvalidConfigException('Invalid size: ' . $this->size);
     }
     if ($this->size !== self::SIZE_NORMAL) {
         Html::addCssClass($this->options, $this->size);
     }
     if ($this->inverted === true) {
         Html::addCssClass($this->options, 'inverted');
     }
     parent::init();
 }
开发者ID:zolotarev,项目名称:yii2-semantic-ui,代码行数:13,代码来源:ActiveForm.php

示例12: init

 /**
  * @inheritDoc
  */
 public function init()
 {
     if (!in_array($this->layout, ['standard', 'horizontal', 'inline'])) {
         throw new InvalidConfigException('Invalid layout type: ' . $this->layout);
     }
     if ($this->layout !== 'standard') {
         Html::addCssClass($this->options, 'form-' . $this->layout);
     }
     if (!isset($this->fieldConfig['class'])) {
         $this->fieldConfig['class'] = ActiveField::className();
     }
     return parent::init();
 }
开发者ID:codemix,项目名称:yii2-bs3activeform,代码行数:16,代码来源:ActiveForm.php

示例13: init

 public function init()
 {
     if ($this->size) {
         UI::addCssClasses($this->options, $this->size);
     }
     if ($this->inverted === true) {
         UI::addCssClasses($this->options, 'inverted');
     }
     if ($this->equalWidth === true) {
         UI::addCssClasses($this->options, 'equal width');
     }
     parent::init();
 }
开发者ID:Vincent-X,项目名称:yii2-semantic-ui,代码行数:13,代码来源:ActiveForm.php

示例14: init

 /**
  * (non-PHPdoc)
  * @see \yii\widgets\ActiveForm::init()
  */
 public function init()
 {
     Pjax::begin(['id' => 'flexform-widget-whole']);
     Pjax::begin(['id' => 'flexform-widget']);
     parent::init();
     if (!isset($this->formModel)) {
         throw new InvalidConfigException("The \$formModel must be setup.");
     }
     $this->_module = Config::initModule(Module::classname());
     $this->modelClass = (new \ReflectionClass($this->formModel->className()))->getShortName();
     $this->template_name = $this->modelClass;
     $this->initTemplate(false);
     $this->prepareModel();
 }
开发者ID:novikas,项目名称:yii2-flexform,代码行数:18,代码来源:FlexibleForm.php

示例15: init

 /**
  * Initializes the widget.
  * This renders the form open tag.
  */
 public function init()
 {
     if (isset($this->options['class']) and strpos($this->options['class'], 'form-horizontal') !== FALSE) {
         $this->isHorizontal = true;
         $this->fieldConfig = function ($model, $atttribute, $options) {
             if (isset($options['inputColumnClass'])) {
                 $inputColumnClass = $options['inputColumnClass'];
             } else {
                 $inputColumnClass = 'col-sm-10';
             }
             return ['template' => "{label}\n<div class=\"" . $inputColumnClass . "\">{input}</div>\n<div class=\"col-md-offset-2 col-md-10\">{error}</div>"];
         };
     }
     M22FormAsset::register(Yii::$app->view);
     parent::init();
 }
开发者ID:griga,项目名称:m22-cms,代码行数:20,代码来源:ActiveForm.php


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