src/Controller/MainController.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. //use Twig\Enviroment;
  4. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  5. use Symfony\Component\HttpFoundation\Response;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. use App\Entity\Applicant;
  9. use App\Form\ApplicantFormType;
  10. class MainController extends AbstractController
  11. {
  12.     /**
  13.      * @Route("/", name="app_index")
  14.      */
  15.      public function index() : Response
  16.      {
  17.         return $this->render('index.html.twig');
  18.      }
  19.     /**
  20.      * @Route("/apply")
  21.      * */
  22.    // public function apply(Environment $twig)
  23.   /* public function apply (Request $request): Response
  24.     {
  25.        $applicant = new Applicant();
  26.        $form = $this->createForm(ApplicantFormType::class, $applicant);
  27.       /* return new Response($twig->render('applicant/show.html.twig', [
  28.         'applicant_form' => $form->createView()
  29.        ]));
  30. return $this->renderForm('applicant/show.html.twig', [
  31.     'form' => $form,
  32. ]);
  33.     }*/
  34.    /* public function number(): Response
  35.     {
  36.         $number = random_int(0, 100);
  37.         return new Response(
  38.             '<html><body>Lucky number: '.$number.'</body></html>'
  39.         );
  40.     }*/
  41. }