diff --git a/src/Controller/AdminController.php b/src/Controller/AdminController.php index 953aa55..baa37f9 100644 --- a/src/Controller/AdminController.php +++ b/src/Controller/AdminController.php @@ -13,8 +13,6 @@ class AdminController extends AbstractController */ public function index(): Response { - return $this->render('admin/index.html.twig', [ - 'controller_name' => 'AdminController', - ]); + return $this->render('admin/index.html.twig'); } } diff --git a/src/Controller/CategoryController.php b/src/Controller/CategoryController.php index 0d805cc..7c2d2ac 100644 --- a/src/Controller/CategoryController.php +++ b/src/Controller/CategoryController.php @@ -17,7 +17,6 @@ class CategoryController extends AbstractController public function index(): Response { return $this->render('category/categories.html.twig', [ - 'controller_name' => 'CategoryController', 'categories' => $this->getDoctrine()->getRepository(Category::class)->findAll() ]); } @@ -40,7 +39,6 @@ class CategoryController extends AbstractController return $this->redirectToRoute('categories'); } return $this->render('category/categories-form.html.twig', [ - 'controller_name' => 'CategoryController', 'form' => $form->createView(), 'title' => 'Add new category' ]); @@ -67,7 +65,6 @@ class CategoryController extends AbstractController return $this->redirectToRoute('categories'); } return $this->render('category/categories-form.html.twig', [ - 'controller_name' => 'CategoryController', 'form' => $form->createView(), 'title' => 'Edit '.$cat->getName() ]); @@ -93,7 +90,6 @@ class CategoryController extends AbstractController public function categorySummary(): Response { return $this->render('category/category_summary.html.twig', [ - 'controller_name' => 'CategoryController', 'Categories' => array_filter($this->getDoctrine()->getRepository(Category::class)->findAll(), static function ($c) {return count($c->getPosts())>=1;}) ]); } diff --git a/src/Controller/CommentController.php b/src/Controller/CommentController.php index 298130e..fdec3b4 100644 --- a/src/Controller/CommentController.php +++ b/src/Controller/CommentController.php @@ -15,7 +15,6 @@ class CommentController extends AbstractController public function index(): Response { return $this->render('comment/comments.html.twig', [ - 'controller_name' => 'CommentController', 'comments' => $this->getDoctrine()->getRepository(Comment::class)->findAll() ]); } @@ -57,7 +56,6 @@ class CommentController extends AbstractController public function recentComment(): Response { return $this->render('comment/recent_comment.html.twig', [ - 'controller_name' => 'CommentController', 'comments' => $this->getDoctrine()->getRepository(Comment::class)->findBy(array('valid' => true), array('createdAt' => 'DESC'), 5, 0) ]); } diff --git a/src/Controller/PostController.php b/src/Controller/PostController.php index 34ea4e2..ea18891 100644 --- a/src/Controller/PostController.php +++ b/src/Controller/PostController.php @@ -2,7 +2,6 @@ namespace App\Controller; -use App\Entity\Category; use App\Entity\Comment; use App\Entity\Post; use App\Form\CommentType; @@ -25,7 +24,6 @@ class PostController extends AbstractController { $repo = $this->getDoctrine()->getRepository(Post::class); return $this->render('home/index.html.twig', [ - 'controller_name' => 'HomeController', 'posts' => $repo->getPublished($page*5, 5), 'pages' => round(count($repo->getPublished())/5, 0, PHP_ROUND_HALF_UP)-1, 'page' => $page @@ -52,7 +50,6 @@ class PostController extends AbstractController $form = $this->commentFormGenerator($post); } return $this->render('post/index.html.twig', [ - 'controller_name' => 'PostController', 'post' => $post, 'form' => $form->createView() ]); @@ -64,7 +61,6 @@ class PostController extends AbstractController public function posts(): Response { return $this->render('post/posts.html.twig', [ - 'controller_name' => 'PostController', 'posts' => $this->getDoctrine()->getRepository(Post::class)->findBy(array(), array('publishedAt' => 'DESC')) ]); } @@ -88,7 +84,6 @@ class PostController extends AbstractController return $this->redirectToRoute('posts'); } return $this->render('post/posts-form.html.twig', [ - 'controller_name' => 'PostController', 'form' => $form->createView(), 'title' => 'Add new post' ]); @@ -117,7 +112,6 @@ class PostController extends AbstractController return $this->redirectToRoute('posts'); } return $this->render('post/posts-form.html.twig', [ - 'controller_name' => 'PostController', 'form' => $form->createView(), 'title' => 'Edit '.$post->getTitle() ]); diff --git a/templates/admin/base-admin.html.twig b/templates/admin/base-admin.html.twig index 64c4a81..0447e88 100644 --- a/templates/admin/base-admin.html.twig +++ b/templates/admin/base-admin.html.twig @@ -2,7 +2,7 @@
-