[SOLVED] Need Help with my Error Controller |
[eluser]Unknown[/eluser]
Hi there, I am developing a project using the latest version of codeigniter. In my routes.php I went ahead and re-routed my 404 error to a custom controller action Code: $route['404_override'] = 'error/not_found'; The error controller, in its entirety: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); Notice I am not using the regular "CI_Controller" as a base class, instead I am using my own, which looks like this Code: class FTS_Controller extends CI_Controller { This all works fine and correct. If you go to http://www.mywebsite.com/thisdoesnotexist, the appropriate view is loaded and I get the 404 error page I created. However, if you go to something like http://www.mywebsite.com/home/thisdoesnotexist it errors out. Note that "home" is an actual controller that exists, however the function "thisdoesnotexist" does not exist in that controller. That is where my problem is, it seems as if the error controller only handles 404s for controllers, not actions of controllers as well... This is the error I get when I go to something like /home/adflkjakd Code: A PHP Error was encountered I first thought that maybe it would work if I just used the original CI_Controller class for the error controller, but changing FTS_Controller to CI_Controller didn't help. I then thought that maybe "error" was a reserved name, so I changed the controllers name to siteerror, and that didn't help either... If any of you have any idea as to what is wrong, I'd highly appreciate it. I've been stuck on this error for about 3 days now... |
Welcome Guest, Not a member yet? Register Sign In |