public FormBuilder::renderFormTokenPlaceholder($placeholder)
#lazy_builder callback; renders form CSRF token.
string $placeholder: A string containing a placeholder, matching the value of the form's #token.
array A renderable array containing the CSRF token.
public function renderFormTokenPlaceholder($placeholder) { return [ '#markup' => $this->csrfToken->get($placeholder), '#cache' => [ 'contexts' => [ 'session', ], ], ]; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Form!FormBuilder.php/function/FormBuilder::renderFormTokenPlaceholder/8.1.x