Anonymous Anonymous - 1 year ago
610 0

Use this code to retrieve the csrf token in the Symfony2 form.

Twig

Get csrf token in form Symfony2

<input type="hidden" id="user__token" name="user[_token]" value="{{ csrf_token('form_name') }}" />