mirror of
https://github.com/flextype/flextype.git
synced 2025-08-17 02:24:05 +02:00
feat(form-plugin): add _csrfHiddenField #360
This commit is contained in:
@@ -591,10 +591,11 @@ class FormController extends Controller
|
||||
*/
|
||||
protected function _csrfHiddenField() : string
|
||||
{
|
||||
$field = '<input type="hidden" name="' . $this->flextype['csrf']->getTokenNameKey() . '" value="' . $this->flextype['csrf']->getTokenName() . '">';
|
||||
$field .= '<input type="hidden" name="' . $this->flextype['csrf']->getTokenValueKey() . '" value="' . $this->flextype['csrf']->getTokenValue() . '">';
|
||||
|
||||
return $field;
|
||||
return $this->flextype['view']->fetch('plugins/form/templates/fields/hidden-csrf/field.html',
|
||||
['getTokenNameKey' => $this->flextype['csrf']->getTokenNameKey(),
|
||||
'getTokenName' => $this->flextype['csrf']->getTokenName(),
|
||||
'getTokenValueKey' => $this->flextype['csrf']->getTokenValueKey(),
|
||||
'getTokenValue' => $this->flextype['csrf']->getTokenValue()]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -0,0 +1,2 @@
|
||||
<input type="hidden" name="{{ getTokenNameKey }}" value="{{ getTokenName }}">
|
||||
<input type="hidden" name="{{ getTokenValueKey }}" value="{{ getTokenValue }}">
|
Reference in New Issue
Block a user