Based on something I saw on Teknoid's blog, I have this in my Admin index():

        $this->set('new_members', 
ClassRegistry::init('Member')->getNewMembers());
        $this->set('new_publications',
ClassRegistry::init('Publication')->getNewPublications());
        ...

Apparently, this is the most efficient way to do it. From what I
gather from the source, I'd say so.

On Sat, Jan 10, 2009 at 7:08 PM, Miles J <[email protected]> wrote:
>
> In one of my controllers, I use nearly 10-15 models. The problem is
> that I dont need all these models, each model is respective to a
> certain action and loading all these models seems like it would be
> heavy and load slowly.
>
> So I tried doing many variations of this in the action:
>
> $this->uses = 'Friend';
> $this->uses[] = 'Friend';
> $this->uses = array('Friend');
>
> But none of that works, but im guessing its because models are loaded
> before the action. Now all I ask is if there is a way to load certain
> models depending on different actions, instead of loading them all.
> >
>

--~--~---------~--~----~------------~-------~--~----~
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