示例#1
0
 public function index($slug)
 {
     # обращаемся к моделе Category
     $vrode_model = new Categories();
     $categories = $vrode_model->cats_for_header();
     // проверка на правильнось данных
     /*
     $post = DB::table('pages')
     ->where('slug', '=', "$slug")
     
     ->get();
     */
     # обращаемся к моделе Page
     $pages = new Page();
     $footer_pages = $pages->footer_pages();
     $post = $pages->page_text($slug);
     return view('layouts.page_lay', ['categories' => $categories, 'pages' => $footer_pages, 'content_layout' => 'post_content', 'post' => $post]);
 }