There's a bug when I try to customized error page, an 404 page - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6) +--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19) +--- Thread: There's a bug when I try to customized error page, an 404 page (/showthread.php?tid=74925) |
There's a bug when I try to customized error page, an 404 page - rikimahendra - 11-25-2019 Hi there's, My case in CI 3.1.11 when I trry to set default 404_override route in config, its work for page when no function show_404() set on my controller. BUT if I set function show_404() on my controller its will return default error page. I need to direct page if no id found on my site. weirdly, when I try this :
and delete your show_404() on your Common.php this my github : My issues on github RE: There's a bug when I try to customized error page, an 404 page - rikimahendra - 12-03-2019 how about to set 404_override on your common.php show_404 function if there's not 404_override set on config/route, so it will return your default error page, BUT... if we set 404_override to our custom error page, its will direct into our page. maybe, on show_404 function we can set a condition like that. ``` function show_404(){ if($route['404_override']==""){ //return your code of show_404 before; }else{ return $route["404_override"] } } ``` so, we can easily use 404 function after set customize page on config/route. hopefully be considered |