Don't flame me I'm just curious..

I've been using cake for quite awhile.
Generally I have a few controllers that implement actions on a
specific model, like a UsersController for instance. The typical crud
operations, user registration, permissions, etc, can be managed there.

Beyond logging in though, the point of entry will almost always be the
DashboardController (or whatever fun name you came up with..) and the
beauty behind cake allows me to make calls to models "dynamically"
because of things like the Controller::$uses array(). The reason I do
this is because cake doesn't handle deep conditions (like so..
http://bin.cakephp.org/saved/19970 [this hasMany that hasMany
someThingElse hasOne thing] and my condition might be on
someThingElse)

In an irc chat today I was told (quite authoritatively in fact) that
the Controller::$uses array was not appropriate in most cases, and
that a Controller has a 'primary model' associated with it. I can read
code, and I see that Controller::__construc() is setting $this-
>modelClass  to the singular version of the name of the controller. I
also realize it could be reset.. $this->modelClass = 'SomeOtherModel';

I can see how using $uses = array() would slow things down a bit as
function constructClasses() foreach's through the array and loads all
the models, but cakes magic is largely done using combinations of for
loops with very little functional recursion. It's hardly efficient in
that regard. (I know.. you have to support php4 and it's limitations)

I've scoured this group for the last 1/2 hour trying to find why this
is. Apparently I tend to overuse the uses array. I feel like this
particular convention really limits how dynamic and powerful cake can
be. Can anyone provide some conventional wisdom here?

Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to