This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace AppBundle\Controller; | |
use AppBundle\Entity\Foo; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Symfony\Component\HttpFoundation\Request; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<a href="{{ path('secure_route', {'id': foo.id }) }}" data-method="POST" data-csrf="{{ csrf_token('foo') }}">submit</a> | |
<script> | |
/** | |
* POST/PUT/DELETE with link | |
* create a form with given HTTP method | |
* Add CSRF token | |
* Append and submit |