src/JuridicusBundle/Controller/ExamensklausurenController.php line 23

Open in your IDE?
  1. <?php
  2. namespace JF\JuridicusBundle\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  5. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  6. use Symfony\Component\Form\Extension\Core\Type\DateType;
  7. use Symfony\Bridge\Doctrine\Form\Type\EntityType;
  8. use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
  9. /**
  10.  * Examensklausuren controller.
  11.  *
  12.  */
  13. class ExamensklausurenController extends AbstractController
  14. {
  15.     /**
  16.      * @Route("/examensklausuren", name="examensklausuren")
  17.      */
  18.     public function indexAction()
  19.     {
  20.         $filter_form $this->createParagraphFilterForm();
  21.         return $this->render("@JFJuridicusBundle/Examensklausuren/index.html.twig", array(
  22.             'filter_form'       => $filter_form->createView(),
  23.         ));
  24.     }
  25.     
  26.     /**
  27.      *
  28.      * @param array $data
  29.      * @return \Symfony\Component\Form\Form
  30.      */
  31.     private function createParagraphFilterForm(array $data = array())
  32.     {
  33.         return $this->createFormBuilder($data)
  34.                 ->add('bundesland'EntityType::class, array(
  35.                      'label'       => false,
  36.                     'class' => 'JF\JuridicusBundle\Entity\Bundesland',
  37.                     'placeholder' => 'Bundesland wählen...',
  38.                     'required' => false,
  39.                     
  40.                 ))
  41.                 ->add('fach'ChoiceType::class, array(
  42.                     'label'       => false,
  43.                     'placeholder' => 'Examen auswählen...',
  44.                     'choices' => array(
  45.                         'Strafrecht' => 'Strafrecht',
  46.                         'Öffentliches Recht' => 'Öffentliches Recht',
  47.                         'Zivilrecht' => 'Zivilrecht',
  48.                         'Arbeitsrecht' => 'Arbeitsrecht',
  49.                         'Verwaltungsrecht' => 'Verwaltungsrecht',
  50.                     ),
  51.                     'required' => false,
  52.                     
  53.                 ))
  54.                 ->add('startdatum'DateType::class, array(
  55.                     'label'       => false,
  56.                     'placeholder' => 'Zeitraum von',
  57.                     'widget'      => 'single_text',
  58.                     //'format'      => 'dd.MM.yyyy',
  59.                     'required'    => false,
  60.                     //'attr'        => ['class' => 'js-datepicker', 'placeholder' => 'Zeitraum von ...',],
  61.                 ))
  62.                 ->add('endedatum'DateType::class, array(
  63.                     'label'       => false,
  64.                     'placeholder' => 'bis ...',
  65.                     'widget'      => 'single_text',
  66.                     //'format'      => 'dd.MM.yyyy',
  67.                     'placeholder' => '',
  68.                     'required'    => false,
  69.                     //'attr'        => ['class' => 'js-datepicker', 'placeholder' => 'bis',],
  70.                 ))
  71.                 ->add('examen'ChoiceType::class, array(
  72.                     'label'       => false,
  73.                     'placeholder' => 'Fach auswählen...',
  74.                     'choices' => array_flip(array( //changedFrom added array_flip
  75.                         '1' => '1. Staatsexamen',
  76.                         '2' => '2. Staatsexamen',
  77.                      )),
  78.                     'required' => false,
  79.                     
  80.                 ))
  81.                 ->getForm();
  82.     }
  83. }