src/Controller/Super/DefaultController.php line 25

Open in your IDE?
  1. <?php
  2. namespace App\Controller\Super;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\HttpFoundation\Response;
  5. use Symfony\Component\Routing\Annotation\Route;
  6. use App\Util\EntityUtil;
  7. /**
  8.  *
  9.  * @author "wendell.zheng <wxzheng@ustc.edu.cn>"
  10.  */
  11. class DefaultController extends AbstractController
  12. {
  13.     /**
  14.      *
  15.      * @Route("/super", name="super")
  16.      */
  17.     public function index(): Response
  18.     {
  19.         return $this->redirectToRoute('super_batch_list');
  20.     }
  21.     public function menu(): Response
  22.     {
  23.         $keys = [
  24.             'Announcement',
  25.             'Batch',
  26.             'Subject',
  27.             'Title',
  28.             'Qualification',
  29.             'Degree',
  30.             'College',
  31.             'Year',
  32.             'Property',
  33.             'ReviewBatch',
  34.             'User',
  35.             'Suggestion'
  36.         ];
  37.         $modules = [];
  38.         foreach ($keys as $key) {
  39.             $entityName EntityUtil::getEntityClassName($key);
  40.             $lower EntityUtil::underscore($key);
  41.             $modules[$lower] = EntityUtil::getEntityZhName($entityName);
  42.         }
  43.         return $this->render('super/_menu.html.twig', [
  44.             'modules' => $modules
  45.         ]);
  46.     }
  47. }