protected function findModel($id)
 {
     if (($model = Advantages::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Пример #2
0
 /**
  * Displays homepage.
  *
  * @return mixed
  */
 public function actionIndex()
 {
     $products = Product::find()->active()->all();
     return $this->render('index', ['products' => $products, 'banners' => Banners::find()->asArray()->all(), 'advantages' => Advantages::find()->asArray()->all()]);
 }