function TwigExtension::getFunctions

Same name in this branch
  1. 11.x core/lib/Drupal/Core/Template/TwigExtension.php \Drupal\Core\Template\TwigExtension::getFunctions()
Same name in other branches
  1. 9 core/lib/Drupal/Core/Template/TwigExtension.php \Drupal\Core\Template\TwigExtension::getFunctions()
  2. 8.9.x core/lib/Drupal/Core/Template/TwigExtension.php \Drupal\Core\Template\TwigExtension::getFunctions()
  3. 10 core/modules/sdc/src/Twig/TwigExtension.php \Drupal\sdc\Twig\TwigExtension::getFunctions()
  4. 10 core/lib/Drupal/Core/Template/TwigExtension.php \Drupal\Core\Template\TwigExtension::getFunctions()

File

core/modules/sdc/src/Twig/TwigExtension.php, line 44

Class

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

Namespace

Drupal\sdc\Twig

Code

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

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