From 7726535de52b01f6e7259172e0a78129fd3db2fa Mon Sep 17 00:00:00 2001 From: Awilum Date: Fri, 1 Mar 2019 18:58:43 +0300 Subject: [PATCH] Flextype Core: Emitter Twig Extension - added --- flextype/twig/EmitterTwigExtension.php | 32 ++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 flextype/twig/EmitterTwigExtension.php diff --git a/flextype/twig/EmitterTwigExtension.php b/flextype/twig/EmitterTwigExtension.php new file mode 100644 index 00000000..7aa7638e --- /dev/null +++ b/flextype/twig/EmitterTwigExtension.php @@ -0,0 +1,32 @@ +flextype = $flextype; + } + + public function getFunctions() + { + return [ + new \Twig_SimpleFunction('emmiter_emmit', array($this, 'emit')), + ]; + } + + public function emit(string $event) + { + return $this->flextype['emitter']->emit($event); + } +}