kartik\grid\GridView::init PHP Method

init() public method

public init ( )
    public function init()
    {
        $this->_module = Config::initModule(Module::className());
        if (empty($this->options['id'])) {
            $this->options['id'] = $this->getId();
        }
        if (!$this->toggleData) {
            parent::init();
            return;
        }
        $this->_toggleDataKey = '_tog' . hash('crc32', $this->options['id']);
        $this->_isShowAll = ArrayHelper::getValue($_GET, $this->_toggleDataKey, $this->defaultPagination) === 'all';
        if ($this->_isShowAll) {
            /** @noinspection PhpUndefinedFieldInspection */
            $this->dataProvider->pagination = false;
        }
        $this->_toggleButtonId = $this->options['id'] . '-togdata-' . ($this->_isShowAll ? 'all' : 'page');
        parent::init();
    }

Usage Example

Esempio n. 1
0
 public function init()
 {
     parent::init();
     if ($this->nestable === true || is_array($this->nestable)) {
         echo $this->nestableGrid();
     }
 }
All Usage Examples Of kartik\grid\GridView::init