Use the new root_path service to make some code more portable
This commit is contained in:
parent
f2be3a7e5b
commit
1e17dff21e
2 changed files with 2 additions and 2 deletions
|
@ -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 {
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue