public function FormBuilder::renderFormTokenPlaceholder in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Form/FormBuilder.php \Drupal\Core\Form\FormBuilder::renderFormTokenPlaceholder()
#lazy_builder callback; renders form CSRF token.
Parameters
string $placeholder: A string containing a placeholder, matching the value of the form's #token.
Return value
array A renderable array containing the CSRF token.
File
- core/
lib/ Drupal/ Core/ Form/ FormBuilder.php, line 664 - Contains \Drupal\Core\Form\FormBuilder.
Class
- FormBuilder
- Provides form building and processing.
Namespace
Drupal\Core\FormCode
public function renderFormTokenPlaceholder($placeholder) {
return [
'#markup' => $this->csrfToken
->get($placeholder),
'#cache' => [
'contexts' => [
'session',
],
],
];
}