Use absolute URLs everywhere, this should fix #3

This commit is contained in:
Bernd Bestel
2018-04-18 19:03:39 +02:00
parent 3d1c6fc5f0
commit 607a90cccc
36 changed files with 207 additions and 159 deletions

View File

@@ -9,8 +9,6 @@ use \Grocy\Services\LocalizationService;
class BaseController
{
public function __construct(\Slim\Container $container) {
$this->AppContainer = $container;
$databaseService = new DatabaseService();
$this->Database = $databaseService->GetDbConnection();
@@ -23,6 +21,12 @@ class BaseController
{
return $localizationService->Localize($text, ...$placeholderValues);
});
$container->view->set('U', function($relativePath) use($container)
{
return $container->UrlManager->ConstructUrl($relativePath);
});
$this->AppContainer = $container;
}
protected $AppContainer;