You are here

public function Security::getFunctions in Bamboo Twig 8.2

Same name and namespace in other branches
  1. 8.5 bamboo_twig_security/src/TwigExtension/Security.php \Drupal\bamboo_twig_security\TwigExtension\Security::getFunctions()
  2. 8 bamboo_twig_security/src/TwigExtension/Security.php \Drupal\bamboo_twig_security\TwigExtension\Security::getFunctions()
  3. 8.3 bamboo_twig_security/src/TwigExtension/Security.php \Drupal\bamboo_twig_security\TwigExtension\Security::getFunctions()
  4. 8.4 bamboo_twig_security/src/TwigExtension/Security.php \Drupal\bamboo_twig_security\TwigExtension\Security::getFunctions()

List of all Twig functions.

File

bamboo_twig_security/src/TwigExtension/Security.php, line 15

Class

Security
Provides a 'Security' Twig Extensions.

Namespace

Drupal\bamboo_twig_security\TwigExtension

Code

public function getFunctions() {
  return [
    new \Twig_SimpleFunction('bamboo_has_permission', [
      $this,
      'hasPermission',
    ]),
    new \Twig_SimpleFunction('bamboo_has_role', [
      $this,
      'hasRole',
    ]),
  ];
}