protected function renderLogin(array $data)
    {
        //Backward compatibility with Fos User 1.3
        if(class_exists('FOS\UserBundle\FOSUserEvents')){
            /** @var $formFactory \FOS\UserBundle\Form\Factory\FactoryInterface */
            $formFactory = $this->container->get('fos_user.registration.form.factory');
            $form = $formFactory->createForm();
        }else{
            $form = $this->container->get('fos_user.registration.form');
        }
        $csrf_token_register = '';
        if(isset($form->createView()->children['_token'])){
            $csrf_token_register = $form->createView()->children['_token']->vars['value'];
        }
        $data['csrf_token_register'] = $csrf_token_register;
        
        return parent::renderLogin($data);
    }
protected function renderLogin(array $data)
    {
        //Backward compatibility with Fos User 1.3
        if(class_exists('FOS\UserBundle\FOSUserEvents')){
            /** @var $formFactory \FOS\UserBundle\Form\Factory\FactoryInterface */
            $formFactory = $this->container->get('fos_user.registration.form.factory');
            $form = $formFactory->createForm();
        }else{
            $form = $this->container->get('fos_user.registration.form');
        }
        $csrf_token_register = '';
        if(isset($form->createView()->children['_token'])){
            $csrf_token_register = $form->createView()->children['_token']->vars['value'];
        }
        $data['csrf_token_register'] = $csrf_token_register;
        
        return parent::renderLogin($data);
    }
protected function renderLogin ( array $ data ) { //Backward compatibility with Fos User 1.3 if ( class_exists ( 'FOS\UserBundle\FOSUserEvents' ) ) { /** @var $formFactory \FOS\UserBundle\Form\Factory\FactoryInterface */ $ formFactory = $ this -> container -> get ( 'fos_user.registration.form.factory' ) ; $ form = $ formFactory -> createForm ( ) ; } else { $ form = $ this -> container -> get ( 'fos_user.registration.form' ) ; } $ csrf_token_register = '' ; if ( isset ( $ form -> createView ( ) -> children [ '_token' ] ) ) { $ csrf_token_register = $ form -> createView ( ) -> children [ '_token' ] -> vars [ 'value' ] ; } $ data [ 'csrf_token_register' ] = $ csrf_token_register ; return parent :: renderLogin ( $ data ) ; }
Agrega el token para el registro de usuario al formulario de inicio de sesion para ofrecer registro desde el mismo
@param array $data
@return type
Agrega el token para el registro de usuario al formulario de inicio de sesion para ofrecer registro desde el mismo