Can anyone tell me how could i validate the data on the other page (where was not created the form object)?
The thing is: on the page ‘A’ i am creating the form object with its own validators and showing the form to the user. But the action goes to the page ‘B’, where i need to validate the data.
I want to do something like this (page ‘B’):
$form = new someForm();
$form->bind($this->getRequest()->getParameter('data'));
if($form->isValid())
{
print 'true';
}
else
{
print 'false';
}
But as you can imagine, it will print ‘false’.
I guess it happens due to CSRF protection of forms in Symfony
Try to use this code