1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-15 01:24:25 +02:00

Flextype Core: using league/event

This commit is contained in:
Awilum
2019-03-01 16:55:25 +03:00
parent 08b754787b
commit e59b97f029
2 changed files with 11 additions and 3 deletions

View File

@@ -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');
}
}

View File

@@ -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
*/