1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-04 04:07:48 +02:00

Code cleanup and refactoring and I18N implementation #5 #1

This commit is contained in:
Awilum
2018-03-12 16:08:17 +03:00
parent 901fb5e714
commit 4836821dc7

View File

@@ -44,6 +44,7 @@ class Rawilum extends Container
*/
protected static function init()
{
// Create container
$container = new static();
$container['filesystem'] = function ($c) {
@@ -74,22 +75,32 @@ class Rawilum extends Container
return new ParsedownExtra();
};
$container['i18n'] = function ($c) {
return new I18n($c);
};
$container['plugins'] = function ($c) {
return new Plugins($c);
};
$container['plugins']->init();
$container['pages'] = function ($c) {
return new Pages($c);
};
$container['pages']->getPage(Url::getUriString());
$container['themes'] = function ($c) {
return new Themes($c);
};
// Init I18n
$container['i18n']->init();
// Init Plugins
$container['plugins']->init();
// Get current page
$container['pages']->getPage(Url::getUriString());
// Return container
return $container;
}
@@ -128,7 +139,7 @@ class Rawilum extends Container
// The page is not processed and not sent to the display.
$this['events']->dispatch('onPageBeforeRender');
// Render the page
// Render current page
$this['pages']->renderPage();
// The page has been fully processed and sent to the display.