yii\widgets\BaseListView::run PHP Method

run() public method

Runs the widget.
public run ( )
    public function run()
    {
        if ($this->showOnEmpty || $this->dataProvider->getCount() > 0) {
            $content = preg_replace_callback("/{\\w+}/", function ($matches) {
                $content = $this->renderSection($matches[0]);
                return $content === false ? $matches[0] : $content;
            }, $this->layout);
        } else {
            $content = $this->renderEmpty();
        }
        $options = $this->options;
        $tag = ArrayHelper::remove($options, 'tag', 'div');
        echo Html::tag($tag, $content, $options);
    }

Usage Example

Beispiel #1
0
 public function run()
 {
     $id = $this->options['id'];
     $options = Json::encode($this->getClientOptions());
     $view = $this->getView();
     InputGridAsset::register($view);
     $view->registerJs("jQuery('#{$id}').mdmInputGrid({$options});");
     \yii\widgets\BaseListView::run();
 }
All Usage Examples Of yii\widgets\BaseListView::run