Symfony 2 form in eZ Publish 5, CSRF intuition -


i'm working on ez publish 5 project. cms based on symfony 2. have built form without class described in tge page : http://symfony.com/doc/current/book/forms.html#using-a-form-without-a-class

on ez publish 5 documentation (https://confluence.ez.no/display/ezp/legacy+configuration+injection) read need set csrf intention parameter 'legacy'. can't figure how this. tried use add method on formbuilder :

$this->createformbuilder()->add('_token', 'csrf', array('intention'=>'legacy');

but error 'could not load type csrf'.

can me on ?

thanks.

okay, have given try.

my first answer question: if don't intend execute legacy kernel code follow-up form, don't need care intention, believe.

intentions between symfony , legacy kernels need match if legacy kernel booted (in case check if there token, , if valid).

if need use legacy kernel, can set intention legacy passing custom form options:

$formoptions = array( 'intention' => 'legacy' ); $form = $this->createformbuilder( null, $formoptions )     ->add( 'text', 'text' )     ->getform(); 

setting default intention explained in http://symfony.com/doc/current/book/forms.html#csrf-protection, wouldn't advise this, unless intend rely on legacy kernel.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -