public function indexAction() { $posts = new Posts(); $posts->getAll(); $view = View::init(); echo $view->render('pages/posts/all.twig', ['title' => 'Блог', 'posts' => $posts->getAll()]); }