/** * Show the application welcome screen to the user. * * @return Response */ public function index() { $main = MainPage::find(1); if (!$main) { abort(404); } return view('static.welcome', ['p' => 'main', 'text' => $main->text, 'l_p_text' => $main->l_p_text, 'r_p_text' => $main->r_p_text]); }
/** * Lists all MainPage models. * @return mixed */ public function actionIndex() { $dataProvider = new ActiveDataProvider(['query' => MainPage::find()]); return $this->render('index', ['dataProvider' => $dataProvider]); }