Form submission is not working for POST method


I’ve just started working on pimcore 5 and working on my custom bundle and have some doubts related to it-

  1. I’m using symfony form builder and when I’m using POST method it is throwing exception as below
    Detected CSRF Attack! Do not do evil things with pimcore … :wink:
    but it is working fine with GET method. What am I doing wrong in this? Form has been created for admin side and route has prefix admin.

  2. Is there any other way to work with forms?

  3. Is there any other way to work with data object classed except creating it manually from admin? Can it be created while installing bundle?

  4. Can I build form using these data object classes?

Thanks for the help in advance :slight_smile:


For the CSRF I had to do the following before it worked for me.

In my template I added below row to my form.

<input type="hidden" name="csrfToken" value="<?= $this->csrfToken ?>">

And this to my controller


Don’t remember all the details at this time, but hope it helps you somehow :slight_smile:


Hi @AndrewAteles
It doesn’t seems to work for me.
I’ve tried another to to put entry of routes in the services and now it is working. But it doesn’t seems to me permanent solution (ignoring routes for csrf validation) .
If you have any other solution, please let me know.

What about the other questions?