Sometimes weird things happens...
I'm developing my web site locally on my PC...things run quite fine...
I have installed Codeigniter Shield ...and now I got the following error:
![[Image: basecontroller_error.png]]()
Any help or hint to fix the issue? Thanks a lot
In my Base Controller I have the following code to have multi language functions:
I'm developing my web site locally on my PC...things run quite fine...
I have installed Codeigniter Shield ...and now I got the following error:
![[Image: basecontroller_error.png]](http://gavs.it/assets/basecontroller_error.png)
Any help or hint to fix the issue? Thanks a lot
In my Base Controller I have the following code to have multi language functions:
Code:
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
// Do Not Edit This Line
parent::initController($request, $response, $logger);
// Preload any models, libraries, etc, here.
// E.g.: $this->session = service('session');
/**
* E.g.: $this->session = \Config\Services::session();
* Ensure that the session is started and running
*/
if (session_status() == PHP_SESSION_NONE) {
$this->session = Services::session();
}
$config = new App();
$language = \Config\Services::language();
$locale = $this->session->get('locale') ?? $this->request->getLocale();
$language->setLocale($locale);
$this->viewData['locale'] = $locale;
$this->viewData['supportedLocales'] = $config->supportedLocales;
}