Welcome Guest, Not a member yet? Register   Sign In
Customize 404 error page but not only the view
#1

I'm trying to customize the 404 error page but the only way I've found is to edit the Routes.php file in the Config folder like so:

PHP Code:
$routes->set404Override(function () {
    return view('pages/my404');
}); 
In this way, however, I have no control because I do not have a Controller and Model (if necessary), but only a view.

Is there a way to switch from the Controller and not directly from the view?
Reply
#2

You can set a controller and method.
See https://codeigniter4.github.io/CodeIgnit...l#override
Reply
#3

(07-21-2022, 01:07 AM)kenjis Wrote: You can set a controller and method.
See https://codeigniter4.github.io/CodeIgnit...l#override

Perfect thanks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB