Advertisement
Guest User

Untitled

a guest
Jun 9th, 2021
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. /**
  2.     * @Route("/admin", name="admin_homepage")
  3.     */
  4.     public function index(PostRepository $postRepository, PostCategoryRepository $postCategoryRepository, UserRepository $userRepository): Response
  5.     {
  6.         $totalPosts = $postRepository->countAll();
  7.         $totalCategories = $postCategoryRepository->countAll();
  8.         $totalUsers = $userRepository->countAll();
  9.  
  10.         return $this->render('admin/index.html.twig', [
  11.             'current_menu' => 'homepage',
  12.             'total_posts' => $totalPosts,
  13.             'total_categories' => $totalCategories,
  14.             'total_users' => $totalUsers
  15.         ]);
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement