function ComponentsTwigExtension::getFunctions

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Template/ComponentsTwigExtension.php \Drupal\Core\Template\ComponentsTwigExtension::getFunctions()
  2. 10 core/lib/Drupal/Core/Template/ComponentsTwigExtension.php \Drupal\Core\Template\ComponentsTwigExtension::getFunctions()

File

core/lib/Drupal/Core/Template/ComponentsTwigExtension.php, line 43

Class

ComponentsTwigExtension
The twig extension so Drupal can recognize the new code.

Namespace

Drupal\Core\Template

Code

public function getFunctions() : array {
  return [
    new TwigFunction('add_component_context', [
      $this,
      'addAdditionalContext',
    ], [
      'needs_context' => TRUE,
    ]),
    new TwigFunction('validate_component_props', [
      $this,
      'validateProps',
    ], [
      'needs_context' => TRUE,
    ]),
  ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.