diff --git a/app/Bootstrap/ViewComposer.php b/app/Bootstrap/ViewComposer.php index 8716ac4..39a37c2 100644 --- a/app/Bootstrap/ViewComposer.php +++ b/app/Bootstrap/ViewComposer.php @@ -17,12 +17,12 @@ class ViewComposer public function __invoke(Config $config, Twig $twig): void { $twig->getEnvironment()->getExtension(CoreExtension::class)->setDateFormat( - $config->get('date_format'), '%d days' + $config->get('date_format', 'Y-m-d H:i:s'), '%d days' ); $twig->getEnvironment()->addFunction( new TwigFunction('asset', function ($path) use ($config) { - return "/app/themes/{$config->get('theme')}/{$path}"; + return "/app/themes/{$config->get('theme', 'defualt')}/{$path}"; }) ); diff --git a/index.php b/index.php index 01268b8..9592e9a 100644 --- a/index.php +++ b/index.php @@ -21,7 +21,7 @@ $container = new Container(); $container->set(Config::class, new Config('app/config')); $container->set(Twig::class, function (Config $config) { return new Twig("app/themes/{$config->get('theme')}", [ - 'cache' => $config->get('view_cache') + 'cache' => $config->get('view_cache', 'app/cache/views') ]); });