I have a sfForm form myForm
with another object form embedded in it.
I print it in the template like this:
<?php echo $myForm; ?>
As far as I know, it's supposed to print the hidden fields by default, but it only prints the id
hidden field, and not the _csrf_token
, why is that?
If I try to print it with echo $myForm['_csrf_token'];
it prints the field just fine.
If I use echo $myForm->renderHiddenFields();
it prints the _csrf_token
field and also the id
hidden field for the second time..
In myForm
I tried to enableLocalCSRFProtection()
and it's still doesn't work.
Any idea how to make myForm
render _csrf_token
field by default?
(placeholder answer, as per comments above)
"It really was the embedding form that was causing the problem! I have a custom SchemaFormatter which ignores the embedded form's label (cause it's ugly when printing) but I messed up the hidden fields printing"