Welcome Guest, Not a member yet? Register   Sign In
Localised 404 error message based on URI segment
#1

(This post was last modified: 02-09-2024, 12:23 PM by Muzikant.)

Hi. I am trying to get a localised 404 error message, if URI segment with supported language is present. If it is not present, it should fallback to default language, as it is with basic localisation.

There is a support for localisation:
PHP Code:
$routes->get('{locale}/books''App\Books::index'); 

And override method for 404 error mesage.
PHP Code:
$routes->set404Override('App\Errors::show404'); 

Is it possible to get something like this?
PHP Code:
$routes->set404Override('{locale}\App\Errors::show404'); 

If you know what I mean. Or I have to check URI segments manually in the override method? Do you have any suggestions?
Reply


Messages In This Thread
Localised 404 error message based on URI segment - by Muzikant - 02-09-2024, 12:18 PM



Theme © iAndrew 2016 - Forum software by © MyBB