Since: 1.0
Author: Kartik Visweswaran (kartikv2@gmail.com)
Inheritance: extends yii\bootstrap\Widget, use trait FormTrait
Example #1
0
 /**
  * Initializes the widget
  *
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     parent::init();
     if (empty($this->dataProvider) || !$this->dataProvider instanceof \yii\data\BaseDataProvider) {
         throw new InvalidConfigException(
             "The 'dataProvider' property must be set and must be an instance of '\\yii\\data\\BaseDataProvider'."
         );
     }
     $this->initOptions();
     $this->registerAssets();
 }
Example #2
0
 /**
  * @inheritdoc
  * @throws InvalidConfigException
  */
 public function init()
 {
     parent::init();
     $dp = static::slash(BaseDataProvider::className());
     if (empty($this->dataProvider) || !$this->dataProvider instanceof BaseDataProvider) {
         throw new InvalidConfigException("The 'dataProvider' property must be set and must be an instance of '{$dp}'.");
     }
     $kvGrid = static::slash(GridView::classname());
     if (empty($this->gridClass)) {
         $this->gridClass = $kvGrid;
     } elseif ($this->gridClass !== $kvGrid && !is_subclass_of($this->gridClass, $kvGrid)) {
         throw new InvalidConfigException("The 'gridClass' must be a class which extends from '{$kvGrid}'.");
     }
     $this->initOptions();
     $this->registerAssets();
 }
Example #3
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     echo $this->contentBefore;
     echo $this->renderFieldSet();
     echo $this->contentAfter;
     echo Html::endTag($this->_tag);
     parent::run();
 }
Example #4
0
 /**
  * @inheritdoc
  */
 public function run()
 {
     echo $this->renderFieldSet();
     echo Html::endTag($this->_tag);
     parent::run();
 }