Welcome Guest, Not a member yet? Register   Sign In
Create a WebSite - Template/Multiple Views
#4

[eluser]jedd[/eluser]
Quote:I saw in the user guide that we can load multiple views and I successfully loaded them, but there's a problem, how can a view load a dynamic content that is supposed to be loaded from another controller?

The trick is to not get yourself in this situation! Wink

If you have code that is required in multiple controllers, then it arguably shouldn't be in a / many controllers - it should be elsewhere, say a library. DRY and all that.

Setting up an architecture where one controller needs to call another will twist you up in knots, and if you only started using CI just recently, you don't want to twist yourself intentionally just yet - there'll be plenty of time for that to happen later.

I see that your code snippets suggested that there was no $data being input to the majority of those. You may wish to explore the option of generating those from within MY_Controller - this is done by extending the CI controller, basically intercepting the normal Controller method that you extend when making your normal controllers.


Messages In This Thread
Create a WebSite - Template/Multiple Views - by El Forum - 03-16-2009, 12:38 PM
Create a WebSite - Template/Multiple Views - by El Forum - 03-16-2009, 12:46 PM
Create a WebSite - Template/Multiple Views - by El Forum - 03-16-2009, 01:14 PM
Create a WebSite - Template/Multiple Views - by El Forum - 03-16-2009, 03:50 PM
Create a WebSite - Template/Multiple Views - by El Forum - 03-16-2009, 05:00 PM
Create a WebSite - Template/Multiple Views - by El Forum - 03-16-2009, 05:20 PM
Create a WebSite - Template/Multiple Views - by El Forum - 03-16-2009, 05:25 PM
Create a WebSite - Template/Multiple Views - by El Forum - 03-16-2009, 05:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB