src/DEVWEB/ColocationBundle/Controller/AdvertController.php
// controller de la vue param.html.twig
controller de la vue param.html.twig
controller de la vue param . html . twig
public function paramAction(Request $request)
  {
    $form = $this->createFormBuilder(null)
    ->add('parametre',            ChoiceType::class, array('choices'  => array('Sombre' => 'sombre',
                                                                          'Clair' => 'clair'
                                                                          )))
    ->add('Changer',      SubmitType::class)
    ->getForm();
    if ($request->isMethod('POST') && $form->handleRequest($request)->isValid()) {
      $donnees = $form->getData();
      $activeTheme = $this->container->get('liip_theme.active_theme');
      $activeTheme->setName($donnees['parametre']);
    }
    return $this->render('@DEVWEBColocation/Advert/param.html.twig', array(
      'form' => $form->createView()
    ));
  }
public function paramAction ( Request $ request ) { $ form = $ this -> createFormBuilder ( null ) -> add ( 'parametre' , ChoiceType :: class , array ( 'choices' => array ( 'Sombre' => 'sombre' , 'Clair' => 'clair' ) ) ) -> add ( 'Changer' , SubmitType :: class ) -> getForm ( ) ; if ( $ request -> isMethod ( 'POST' ) && $ form -> handleRequest ( $ request ) -> isValid ( ) ) { $ donnees = $ form -> getData ( ) ; $ activeTheme = $ this -> container -> get ( 'liip_theme.active_theme' ) ; $ activeTheme -> setName ( $ donnees [ 'parametre' ] ) ; } return $ this -> render ( '@DEVWEBColocation/Advert/param.html.twig' , array ( 'form' => $ form -> createView ( ) ) ) ; }
controller de la vue param.html.twig
controller de la vue param . html . twig