Welcome Guest, Not a member yet? Register   Sign In
Partial Views (i think)..
#1

[eluser]Korhal[/eluser]
Hi guys,

I posted a thread a few days back but it didn't take the direction I was looking for, so I will try again and fingers cross explain a little better.

I have a list of controllers.. Home, League, Forum as so on. Once the controller has its data it calls down to a view named template which in turn calls the default header, footer, content and sidebar views. (The content variable is set by the controller).

So far so good, this works great until I realise the need the sidebar data to be dynamic instead of its current static state.. Now as the site grows larger I would prefer not to have to specify the data that gets called for the sidebar each time.

I would prefer to set a variable in the controller that loads "widgets" possibly, I see this being done in the template view, however I know controllers can not be called in view, so I am stuck.

$sidebar = array('latest_news','latest_forum');

Currently I am emulating this affect with Ajax... I specify a list of variables in the controller. The template loops the variables and does an Ajax request for each required widget, pushing them into a div..

There must be a better way...
Example: http://dev.banelingnest.com/

Now i have looked at HMVC and i cant wrap my head around it. It rather seems bloated for my limited requirements. Does anyone have a nice and simple way of achieving this?

Thanks in advance..
Korhal


Messages In This Thread
Partial Views (i think).. - by El Forum - 06-10-2011, 08:21 AM
Partial Views (i think).. - by El Forum - 06-10-2011, 09:06 AM
Partial Views (i think).. - by El Forum - 06-10-2011, 09:22 AM
Partial Views (i think).. - by El Forum - 06-10-2011, 11:02 AM
Partial Views (i think).. - by El Forum - 06-11-2011, 01:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB