示例#1
0
 /** {@inheritdoc} */
 public function afterPerform()
 {
     if ($this->collection->count() === 0) {
         throw new NotFoundHttpException('Object not found');
     }
     parent::afterPerform();
 }
示例#2
0
 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());
 }