src/Controller/Admin/DefaultController.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Admin;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use App\Repository\BatchRepository;
  7. /**
  8.  *
  9.  * @author "wendell.zheng <wxzheng@ustc.edu.cn>"
  10.  */
  11. class DefaultController extends AbstractController
  12. {
  13.     /**
  14.      *
  15.      * @Route("/admin", name="admin")
  16.      */
  17.     public function index(BatchRepository $br): Response
  18.     {
  19.         $batches $br->list();
  20.         return $this->render('admin/index.html.twig', [
  21.             'title' => '批次',
  22.             'entities' => $batches
  23.         ]);
  24.     }
  25. }