diff --git a/flextype/Plugins.php b/flextype/Plugins.php index 5332f9b2..75e823cb 100755 --- a/flextype/Plugins.php +++ b/flextype/Plugins.php @@ -102,11 +102,11 @@ class Plugins } } - Plugins::createPluginsDictionary($plugins_list); + $this->createPluginsDictionary($plugins_list); - Plugins::includeEnabledPlugins($flextype, $app); + $this->includeEnabledPlugins($flextype, $app); - //Event::dispatch('onPluginsInitialized'); + $this->flextype['emitter']->emit('onPluginsInitialized'); } } diff --git a/flextype/bootstrap.php b/flextype/bootstrap.php index cc06cfc7..8cf1836c 100755 --- a/flextype/bootstrap.php +++ b/flextype/bootstrap.php @@ -22,6 +22,7 @@ use Slim\Http\Request; use Slim\Http\Response; use League\Glide\ServerFactory; use League\Glide\Responses\SlimResponseFactory; +use League\Event\Emitter; /** * The version of Flextype @@ -65,6 +66,13 @@ $app = new \Slim\App($config); */ $flextype = $app->getContainer(); +/** + * Add emitter service to Flextype container + */ +$flextype['emitter'] = function($container) { + return new Emitter(); +}; + /** * Add registry service to Flextype container */