extending MY_Controller |
[eluser]kmunky[/eluser]
ok, i have read on the forum how to extend Controller class but i can't find an answer to my problem. i have application/libraries/MY_Controller.php Code: class MY_Controller extends Controller(){ then i try to extend MY_Controller, (i'm trying to get two controllers, one for the frontend and oane for the admin section of my site) application/libraries/F_Controller.php Code: class F_Controller extends MY_Controller{ application/controllers/contact.php Code: class Contact extends F_Controller{ but all i get is Fatal error: Class 'F_Controller' not found in C:\wamp\www\...\contact.php
[eluser]TaylorOtwell[/eluser]
The system is never loading F_Controller. It will only check application/core for a MY_Controller. The first thought that jumps to mind is you could setup a "pre_controller" hook that would just include your F_Controller file.
[eluser]TaylorOtwell[/eluser]
Look at the section on "hooks" in the User Guide. It gives details instructions much better than I could give.
[eluser]n0xie[/eluser]
You can use an autoloader to do this. See this article by Phil Sturgeon about Base Classes |
Welcome Guest, Not a member yet? Register Sign In |