![]() |
Including one controller into a main controller - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Including one controller into a main controller (/showthread.php?tid=27539) |
Including one controller into a main controller - El Forum - 02-13-2010 [eluser]Haskabab[/eluser] Hello guys, I've previously started a topic on how to create a template system. And it really helped me with creating a main template and dividing it into different views and load them all into each other etc. Now i've encountered a problem which i'm pretty sure is unfixable, by doing it my way. So i think that i'm searching in the wrong direction here so i hope someone can help me with it. What i've got so far is a main template view looking like this: (stripped code, just for showing you guys what i mean. Code: <html> And here is my "Main" controller, which is autoloaded when visiting the site: Code: <?php And maybe for some clarity here is my menu view: Code: <?php foreach($menu_info as $info => $link): ?> But now!. My main question is: How can i autoload a controller into my main template if no uri is present, and if there is, how to load that controller before the page renders. I though that i should write some code in my main controller since that is where the master template is loaded but i dont know how i should do that. And any other way i thought about turned out to be complete nonsense... So maybe someone knows how to do it. Btw, i'm using a MY_Controller, which is: Code: class MY_Controller extends Controller { So yeah, if anyone has some feedback? Thanks in advance. ~Nick Including one controller into a main controller - El Forum - 02-14-2010 [eluser]Haskabab[/eluser] No replies at all? |