Order of models in $uses

2009-06-23 Thread DavidH
Hi What's the convention for specifying additional models in the controller $uses variable? I have a controller, DashboardsController, that needs to access the KpiLevel and KpiColour models as well as the Dashboard model. So my controller starts: class DashboardsController extends

Re: Order of models in $uses

2009-06-23 Thread brian
I think the main model has to be first. Have a look at Controller::constructClasses(). Specifically, this line: $modelClassName = $uses[0]; On Tue, Jun 23, 2009 at 8:44 AM, DavidHdjhollingwo...@gmail.com wrote: Hi What's the convention for specifying additional models in the controller

Re: Order of models in $uses

2009-06-23 Thread brian
On Tue, Jun 23, 2009 at 11:10 AM, brianbally.z...@gmail.com wrote: I think the main model has to be first. Have a look at Controller::constructClasses(). Specifically, this line: $modelClassName = $uses[0]; Then have a look at paginate(). I think the problem is that you're not passing the

Re: Order of models in $uses

2009-06-23 Thread DavidH
Thanks for your help Brian, I'm going to try that now. Regards David On Jun 23, 4:16 pm, brian bally.z...@gmail.com wrote: On Tue, Jun 23, 2009 at 11:10 AM, brianbally.z...@gmail.com wrote: I think the main model has to be first. Have a look at Controller::constructClasses().

Re: Order of models in $uses

2009-06-23 Thread arif hossen
Please use this code: function index() { $this-Dashboard-recursive = 0; $this-set('dashboards', $this-paginate($this-Dashboard)); } On Tue, Jun 23, 2009 at 9:34 PM, DavidH djhollingwo...@gmail.com wrote: Thanks for your help Brian, I'm going to try that

Re: Order of models in $uses

2009-06-23 Thread DavidH
Thanks Guys Both solutions worked, not sure if one is 'more correct' than the other; but both seemed to do the job. Regards David On Jun 23, 7:41 pm, arif hossen arifhossen2...@gmail.com wrote: Please use this code: function index() {                $this-Dashboard-recursive = 0;        

Re: Order of models in $uses

2009-06-23 Thread Miles J
Why not just called the right Model in pagination? $this-paginate('Dashboard') --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To