MVC nesting
Coursework for the MSc has been going at varying speeds for a week now. I lost sleep earlier on when trying fine tune the MVC setup (no Cake here). Then things sped up nicely over the weekend when I began happily juggling tabled views around.
Then I thought it might be nice to display the user’s basket on all relevant pages, as a courtesy. This was easier than I’d thought. I simply add a new MVC and merge it’s results.
I have a master array of values matching each area of my template, I array_merge it with that which I receive from View to populate the page. If a user is logged in, a new step merges the user info MVC set with the main View prior to overwriting the defaults. This handles and returns all their account/basket details neatly into a sidebar, all without breaking the rules or setting up problems for later.

save to del.icio.us