You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use \ParagonIE\AntiCSRF\AntiCSRF;
$twigEnv->addFunction(
new \Twig_SimpleFunction(
'form_token',
function($lock_to = null) {
static $csrf;
if ($csrf === null) {
$csrf = new AntiCSRF;
}
return $csrf->insertToken($lock_to, false);
},
['is_safe' => ['html']]
)
);
if put just this in my twig file
{{ form_csrf() }}
I get an error stating that $lock_to must be a string, not null. Not sure if this is intended or not, but if I define lock_to as '' it works since it is a string now.
-Matt
The text was updated successfully, but these errors were encountered:
What type of error is it, Type out the exact output. Make the parameter that you are passing in the form_token function is a string. I noticed you tried {{ form_csrf() }}, but in the documentation it says to use {{ form_token() }}. The string parameter needs to be a local path.
If I use the readme example:
if put just this in my twig file
{{ form_csrf() }}
I get an error stating that $lock_to must be a string, not null. Not sure if this is intended or not, but if I define lock_to as '' it works since it is a string now.
-Matt
The text was updated successfully, but these errors were encountered: