src/Bse/CandidatureBundle/Controller/CandidatureController.php
/**
     * Displays a form to create a new Candidature entity.
     *
     */
Displays a form to create a new Candidature entity.
Displays a form to create a new Candidature entity .
public function newAction($first)
    {
        $user = $this->get('security.context')->getToken()->getUser();        
        $entity = new Candidature();
        $form   = $this->createCreateForm($entity);
        return $this->render('BseCandidatureBundle:Candidature:new.html.twig', array(
            'entity' => $entity,
            'form'   => $form->createView(),            
            'filieresData' => ArrayData::getFilieresData($this->container),
            'paysData' => ArrayData::getPaysData($this->get('kernel')),
            'villesData' => ArrayData::getVillesData($this->get('kernel')),
            'systemesData' => ArrayData::getSystemesData(),
            'mentionsData' => ArrayData::getMentionsData(),
            'etablissementsData' => ArrayData::getEtablissementsData($this->get('kernel')),
            'typesDiplomeData' => ArrayData::getTypesDiplomeData(),
            'intitulesDiplomeData' => ArrayData::getIntitulesDiplomeData($this->get('kernel')),
            'facultesData' => ArrayData::getFacultesData()
        ));
    }
public function newAction ( $ first ) { $ user = $ this -> get ( 'security.context' ) -> getToken ( ) -> getUser ( ) ; $ entity = new Candidature ( ) ; $ form = $ this -> createCreateForm ( $ entity ) ; return $ this -> render ( 'BseCandidatureBundle:Candidature:new.html.twig' , array ( 'entity' => $ entity , 'form' => $ form -> createView ( ) , 'filieresData' => ArrayData :: getFilieresData ( $ this -> container ) , 'paysData' => ArrayData :: getPaysData ( $ this -> get ( 'kernel' ) ) , 'villesData' => ArrayData :: getVillesData ( $ this -> get ( 'kernel' ) ) , 'systemesData' => ArrayData :: getSystemesData ( ) , 'mentionsData' => ArrayData :: getMentionsData ( ) , 'etablissementsData' => ArrayData :: getEtablissementsData ( $ this -> get ( 'kernel' ) ) , 'typesDiplomeData' => ArrayData :: getTypesDiplomeData ( ) , 'intitulesDiplomeData' => ArrayData :: getIntitulesDiplomeData ( $ this -> get ( 'kernel' ) ) , 'facultesData' => ArrayData :: getFacultesData ( ) ) ) ; }
Displays a form to create a new Candidature entity.
Displays a form to create a new Candidature entity .
// force going to first candidature if user is not connect and is asking a new candidature without first /* if(!$user instanceof FOSUserEntity && $first != 'first'){
            return $this->redirect($this->generateUrl('candidature_new', array('first' => 'first')));
        }
        // force going to second candidature if user is connect and is asking a to make candidature as his first one
        if($user instanceof FOSUserEntity && $first == 'first'){ // just in case !! 
             return $this->redirect($this->generateUrl('candidature_new'));
        }*/