Esempio n. 1
0
 public function post($year, $month, $day, $slug)
 {
     # обращаемся к моделе Category
     $vrode_model = new Categories();
     $categories = $vrode_model->cats_for_header();
     // проверка на правильнось данных
     $posts_model = new Posts();
     $post = $posts_model->post($slug);
     # обращаемся к моделе Page
     $pages = new Page();
     $footer_pages = $pages->footer_pages();
     # получим ссылку на следующий/предидущий пост
     $post_prew_next = $posts_model->post_prew_next($post[0]->post_id);
     //$post_prew_next=[5,6];
     return view('layouts.post_lay', ['categories' => $categories, 'pages' => $footer_pages, 'content_layout' => 'post_content', 'post' => $post, 'post_prew_next' => $post_prew_next]);
 }