public function TwigExtenderService::getFunctions in Twig Extender 8.2
Same name and namespace in other branches
- 8.4 src/TwigExtenderService.php \Drupal\twig_extender\TwigExtenderService::getFunctions()
- 8 src/TwigExtenderService.php \Drupal\twig_extender\TwigExtenderService::getFunctions()
- 8.3 src/TwigExtenderService.php \Drupal\twig_extender\TwigExtenderService::getFunctions()
- 4.x src/TwigExtenderService.php \Drupal\twig_extender\TwigExtenderService::getFunctions()
Load all function plugins.
Overrides TwigExtension::getFunctions
File
- src/
TwigExtenderService.php, line 35
Class
- TwigExtenderService
- Service Provider Class for TwigExtesion Plugins.
Namespace
Drupal\twig_extenderCode
public function getFunctions() {
$functions = parent::getFunctions();
foreach ($this->plugins as $id => $plugin) {
$plugin = $this->pluginManager
->createInstance($id, $plugin);
if ($plugin
->getType() != 'function') {
continue;
}
$functions[] = $plugin
->register();
}
return $functions;
}