Thanks for your response. I'm actually only trying to push one variable into the view so its not an issue of usage, its more personal preference I guess. I've used CakePHP, a bit of ZF and also a custom framework using Smarty and in all those cases its possible to push data into the view bit by bit so I guess I'm used to that and find it more convenient.
I guess its not a big issue as I can build up an array, bit by bit, with all the different bits of data that I want to push in and then at the end just push this array into the view. I understand what you are saying and agree with you on skinny controllers.
Mike, on 01 November 2010 - 05:29 AM, said:
Short answer: No.
Longer answer: It sounds like you have a lot of variables to push into the view. This could be a sign that your code has some room for improvement. If for example you pass the same set of related variables again and again in different controller actions, maybe you can group them into their own model class and build some convenient interface to access all these values. Then all you'd have to do in your controller is to instantiate that model class and push it into the view.
Also keep the "skinny controller - fat model" concept in mind: Put as many data related logic into the model. Controllers should not have to fiddle about your data too much.