diff --git a/classes/Factory/ConfigFactory.php b/classes/Factory/ConfigFactory.php index c408b0e..beab456 100644 --- a/classes/Factory/ConfigFactory.php +++ b/classes/Factory/ConfigFactory.php @@ -22,7 +22,7 @@ class ConfigFactory */ public static function create(Container $container): Config { - $configPath = __DIR__ . '/../../config/config.yml'; + $configPath = $container->get('root_path') . '/config/config.yml'; if (is_file($configPath)) { $config = Config::fromFile($configPath); } else { diff --git a/classes/Factory/ViewFactory.php b/classes/Factory/ViewFactory.php index e941663..591369d 100644 --- a/classes/Factory/ViewFactory.php +++ b/classes/Factory/ViewFactory.php @@ -52,7 +52,7 @@ class ViewFactory $request = $container->get('request'); } - $view = new Smarty(__DIR__ . '/../../templates/'); + $view = new Smarty($container->get('root_path') . '/templates/'); /** @var Uri $uri */ $uri = $request->getUri();