diff options
Diffstat (limited to 'lib/Controller/PageController.php')
-rw-r--r-- | lib/Controller/PageController.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 4f4c722e..eebfccf8 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -25,7 +25,7 @@ namespace OCA\Contacts\Controller; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\TemplateResponse; -use OCP\IInitialStateService; +// use OCP\IInitialStateService; use OCP\L10N\IFactory; use OCP\IRequest; @@ -33,20 +33,20 @@ class PageController extends Controller { protected $appName; - /** @var IInitialStateService */ - private $initialStateService; + // /** @var IInitialStateService */ + // private $initialStateService; /** @var IFactory */ private $languageFactory; public function __construct(string $AppName, IRequest $request, - IInitialStateService $initialStateService, + // IInitialStateService $initialStateService, IFactory $languageFactory) { parent::__construct($AppName, $request); $this->appName = $AppName; - $this->initialStateService = $initialStateService; + // $this->initialStateService = $initialStateService; $this->languageFactory = $languageFactory; } @@ -58,7 +58,8 @@ class PageController extends Controller { */ public function index(): TemplateResponse { $locales = $this->languageFactory->findAvailableLocales(); - $this->initialStateService->provideInitialState($this->appName, 'locales', $locales); - return new TemplateResponse('contacts', 'main'); // templates/main.php + // TODO: use initialStateService once min-version is 16! + // $this->initialStateService->provideInitialState($this->appName, 'locales', $locales); + return new TemplateResponse('contacts', 'main', ['locales' => json_encode($locales)]); // templates/main.php } } |