PHP code example of korotovsky / csrf-validator-bundle
1. Go to this page and download the library: Download korotovsky/csrf-validator-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
korotovsky / csrf-validator-bundle example snippets
// app/AppKernel.php
public function registerBundles()
{
return array(
// ...
new Krtv\Bundle\CsrfValidatorBundle\KrtvCsrfValidatorBundle(),
// ...
);
}
// Acme\MainBundle\Controller\DefaultController.php
use Krtv\Bundle\CsrfValidatorBundle\Annotations as Krtv;
/**
* @Krtv\Csrf(intention="your_intention")
* @return Response
*/
public function importantZoneAction()
{
// some code here ...
return new Response();
}