Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @Route("/admin", name="admin_homepage")
- */
- public function index(PostRepository $postRepository, PostCategoryRepository $postCategoryRepository, UserRepository $userRepository): Response
- {
- $totalPosts = $postRepository->countAll();
- $totalCategories = $postCategoryRepository->countAll();
- $totalUsers = $userRepository->countAll();
- return $this->render('admin/index.html.twig', [
- 'current_menu' => 'homepage',
- 'total_posts' => $totalPosts,
- 'total_categories' => $totalCategories,
- 'total_users' => $totalUsers
- ]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement