CodeIgniter Forums
Setting 404_override - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Setting 404_override (/showthread.php?tid=66139)



Setting 404_override - ukitconsultant - 09-12-2016

Hi everyone, 

This is the first day I've ever played with codeigniter for more than 10 minutes, and this is the first time I've built something from scratch. 

I'm setting the 404_override variable in the /application/config/routes.php file. I want to set it to 'errorh/pages/404' so it would call the 'Errorh' controller, the 'pages' function and set the first variable to '404'. 

Except everytime I do this, it tries to tell me that a function called pages/404 is missing? Am I being stupid here? It works on the rest of the routes I've setup, but not on the 404_override one.

Is it possible that this specific route cannot support passing a variable over like the other ones do? 

Thanks in advance everyone!


RE: Setting 404_override - wolfgang1983 - 09-12-2016

On the version 3 + of codeigniter it does not work in sub folders

In Correct

Code:
application > controllers > pages > Error_404.php

PHP Code:
$route['404_override'] = 'pages/error_404'

Correct

Code:
application > controllers > Error_404.php

PHP Code:
$route['404_override'] = 'error_404'



Note: Follow the Codeigniter file and class name style guide


RE: Setting 404_override - ukitconsultant - 09-13-2016

This has nothing to do with what I've asked. 

I never said anything about subfolders. I was talking about passing the variable over to the pages method. As I've explained above.