/** {@inheritdoc} */ public function afterPerform() { if ($this->collection->count() === 0) { throw new NotFoundHttpException('Object not found'); } parent::afterPerform(); }
protected function getDefaultRules() { return array_merge(['html | pjax' => ['save' => false, 'flash' => false, 'success' => ['class' => RenderAction::class, 'view' => $this->getView(), 'data' => $this->data, 'params' => function () { return ['model' => $this->getSearchModel(), 'dataProvider' => $this->getDataProvider()]; }]]], parent::getDefaultRules()); }