calling an application within an application (NOOB) - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: calling an application within an application (NOOB) (/showthread.php?tid=11055) |
calling an application within an application (NOOB) - El Forum - 08-24-2008 [eluser]Unknown[/eluser] Sorry noob here, I am stuck and can't seem to figure it how it works. What i want is to have a seperate application namely nav that returns a string/links. I want that application nav to be called by my main application layout and use its return value on the layout_view. Ex. I have 2 applications namely 1. layout Code: class Layout extends Controller { 2. nav Code: class Nav extends Controller { Layout_view code Code: <html> nav_view code Code: <td>Home</td> How can I get the return value of the nav application and use it on my layout application then pass it on the layout view {nav} as you can see on the table class nav_bar. This is to be used for different page regions but I don't want to use any template library. What i want is different page regions have its own application. Is this possible? Hope I made myself clear. Sorry I am really a 1 day CI noob. TIA calling an application within an application (NOOB) - El Forum - 08-24-2008 [eluser]Pascal Kriete[/eluser] Hey betlog, First a little terminology. What you have here is a bunch of controllers - an application is the whole package. Normally you can nest view loading calls, but I can't recall from the top of my head how it works for the parser. In lieu of that, the best way to go is to create a library (or in this case: a helper) to do what you need. The use of cross-controller calls is very limited, hard to maintain, usually bad practice, and hence not included in the framework. Generally, if more than one controller needs a piece of code it's time for a library or helper. After all, that's what they're there for. Hope that helps and welcome to CodeIgniter. |