src/Lokos/ShopBundle/Controller/BaseController.php
/**
     * Checks token when AJAX request has been sent
     *
     * @param \Symfony\Component\HttpFoundation\Request $request
     *
     * @throws TokenException When token is invalid
     */
Checks token when AJAX request has been sent
@param \Symfony\Component\HttpFoundation\Request $request

@throws TokenException When token is invalid
Checks token when AJAX request has been sent @param \ Symfony \ Component \ HttpFoundation \ Request $request @throws TokenException When token is invalid
public function checkToken(Request $request)
    {
        $request = $this->getRequestContent($request);
        if (empty($request->_token) ||
            !$this->container->get('form.csrf_provider')->isCsrfTokenValid('unknown', $request->_token)
        ) {
            throw $this->createTokenException(
                $this->get('translator')->trans('ERROR_TOKEN_INVALID', array(), 'validators')
            );
        }
    }
public function checkToken ( Request $ request ) { $ request = $ this -> getRequestContent ( $ request ) ; if ( empty ( $ request -> _token ) || ! $ this -> container -> get ( 'form.csrf_provider' ) -> isCsrfTokenValid ( 'unknown' , $ request -> _token ) ) { throw $ this -> createTokenException ( $ this -> get ( 'translator' ) -> trans ( 'ERROR_TOKEN_INVALID' , array ( ) , 'validators' ) ) ; } }
Checks token when AJAX request has been sent
 @param \Symfony\Component\HttpFoundation\Request $request
Checks token when AJAX request has been sent @param \ Symfony \ Component \ HttpFoundation \ Request $request