About to write a view that has numerous lists of models (in this case, ‘jobs’). Was toying with the idea of doing one SQL array of jobs that encompasses all active jobs and the view has numerous ‘foreach’ loop statements parsing thru this to create the 8 or so lists (ie active jobs for user 1, active jobs for user 2, etc, future jobs for user 1, future jobs for user 2, etc, overdue jobs for user 1, overdue jobs for user 2, etc etc)
So in controller,
and parse multiple foreachs in view, or go the multiple SQL queries and do,
$this->render('board', array('actjobsusr1'=>$actjobsusr1, 'actjobsusr2'=>actjobsusr2, etc etc))
Curious on which is more efficient, and best practice…
Thx for your vauable input!