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); + } +}