Welcome Guest, Not a member yet? Register   Sign In
set404Override - setLocale not working?
#1
Question 
(This post was last modified: 03-22-2020, 05:21 PM by haugli92.)

Hi!

I'm just wondering why the controller set in set404Override() not listening to the selected locale. Is this a feature or a bug?
Any other controller is working properly.

app/Config/Routes.php
PHP Code:
$routes->set404Override('App\Controllers\Error::error_404'); 

app/Controllers/Error.php
PHP Code:
<?php namespace App\Controllers;
 
class 
Error extends BaseController {
  public function error_404() {
    echo $this->request->getLocale(); //Output: no (Norwegian)
 
    echo view('_includes/header_clean'); // Outputs data from en (English)
    echo view('main/main');              // Outputs data from en (English)
    echo view('_includes/footer_clean'); // Outputs data from en (English)
 
    echo $this->request->getLocale(); //Output: no (Norwegian)
  }

Reply


Messages In This Thread
set404Override - setLocale not working? - by haugli92 - 03-22-2020, 05:12 PM



Theme © iAndrew 2016 - Forum software by © MyBB