public function getNews(NewsRequest $request) { $type = $request->tin; $model_data = new Data(); $model_statistic = new Statistic(); $input = ''; switch ($type) { case 'thoisu': case 'thethao': case 'phapluat': case 'thegioi': case 'giaoduc': case 'suckhoe': case 'giadinh': case 'dulich': case 'khoahoc': case 'sohoa': case 'congdong': $input = $type; break; default: //$input = 'thoisu'; } //switch $var = ['nav_view_top' => $this->getNavTop(), 'view_menu' => 'menu.php', 'view_do_day' => $model_data->getTopLatest(4, ''), 'top_1_new' => array_shift($model_data->getTopLatest(1, $input)), 'top_10_new' => $model_data->getTopLatest(10, $input), 'top_5_hot' => $model_statistic->getTopHot(5, $input), 'all_news' => $model_data->getTopLatest(10, $input, 10)]; return view('tintuc', $var); }