Ok, I have MY_Controller but now I want to create Front_End_Controller |
[eluser]kyleect[/eluser]
I've created MY_Controller inside of Application/Libraries and now I want to create a front end controller that extends off MY_Controller. This will be used by any controller that outputs HTML. I did some searching but didn't find any info on where to place that front end controller file and how CI will handle my extending off that controller. I guess I have a related question, do you see this is as needed. I have a lot of code in my MY_Controller that has to do with prepping views and outputting HTML however not all my controllers would output HTML. Take a look: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
[eluser]brianw1975[/eluser]
heheh not willing to look through all the code to evaluate it, but you should be able to make "MY_FEC.php" and put it in application/libraries/ and for code do the same as before: Code: <?php and in the controllers that use the front end controller you will have: Code: <?php note that MY_FEC was arbitrary...
[eluser]kyleect[/eluser]
That did not work. My front controller couldn't be found, which means I could include it manually but is that the only way to do it? Is there a way to do this natively within CI?
[eluser]brianw1975[/eluser]
Interesting... I thought this would work, I'm surprised that once the base Controller is extended it wouldn't allow further extending... anyways, sit back and relax, someone else will have the correct answer.
[eluser]devbro[/eluser]
I had this problem before you only have one of the following options: 1. put all classes that you extend from Controller in MY_controller.php 2. put them in their own file and do include inside MY_controller.php These are the only solutions at this point. worst come to worse look up HMVC and matchbox |
Welcome Guest, Not a member yet? Register Sign In |