yii\grid\GridView::init PHP Method

init() public method

This method will initialize required property values and instantiate [[columns]] objects.
public init ( )
    public function init()
    {
        parent::init();
        if ($this->formatter === null) {
            $this->formatter = Yii::$app->getFormatter();
        } elseif (is_array($this->formatter)) {
            $this->formatter = Yii::createObject($this->formatter);
        }
        if (!$this->formatter instanceof Formatter) {
            throw new InvalidConfigException('The "formatter" property must be either a Format object or a configuration array.');
        }
        if (!isset($this->filterRowOptions['id'])) {
            $this->filterRowOptions['id'] = $this->options['id'] . '-filters';
        }
        $this->initColumns();
    }

Usage Example

Example #1
0
 /**
  * Inits widget
  */
 public function init()
 {
     parent::init();
     $this->initVisible();
     $this->initSortable();
     //GridViewAsset::register($this->view);
 }
All Usage Examples Of yii\grid\GridView::init