src/Controller/Admin/DashboardController.php line 38

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Admin;
  3. use App\Entity\City;
  4. use App\Entity\Province;
  5. use App\Entity\User;
  6. use App\Form\AddToListMultipleType;
  7. use Doctrine\ORM\EntityManagerInterface;
  8. use Knp\Component\Pager\PaginatorInterface;
  9. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  10. use Symfony\Component\HttpFoundation\Request;
  11. use Symfony\Component\HttpFoundation\Response;
  12. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  13. use Symfony\Component\Routing\Annotation\Route;
  14. use function PHPUnit\Framework\throwException;
  15. /**
  16.  * @Route("/admin", name="admin_")
  17.  */
  18. class DashboardController extends AbstractController
  19. {
  20.     protected EntityManagerInterface $em;
  21.     protected PaginatorInterface $paginator;
  22.     protected $itemsOptions = [10, 20, 30];
  23.     public function __construct(EntityManagerInterface $entityManager, PaginatorInterface $paginator)
  24.     {
  25.         $this->em = $entityManager;
  26.         $this->paginator = $paginator;
  27.     }
  28.     /**
  29.      * @Route("/", name="admin")
  30.      */
  31.     public function admin(Request $request) :Response
  32.     {
  33.         return $this->redirectToRoute('admin_users_list');
  34.     }
  35. }