There are a few ways:
 If It's a model associated with This Model (like hasMany, HABTM, etc)
, you would trye this in your controller:
$this->Model1->Model2->findAll()

 If you want to do other operations, you might use
var $uses = array('Model1','Model2','Model3');
$this->Model1->findAll()
$this->Model2->findAll()
$this->Model3->findAll()

  Or if want to access an Action of a Model, you may call it , use
RequesAction. It executes and return a value or the rendered page:
(Chapter 7 in the manual)
requestAction($url, $extra = array())
$url is like '/galleries/view/3'

an useful example from the manual:
$this->set('users', $this->requestAction('/users/getUserList'));

and, to render the same action, just do an 'echo' to the var
$userTable in your view:
$this->set('userTable', $this->requestAction('/users/getUserList',
array('return')));


spark


On 5/30/06, monty <[EMAIL PROTECTED]> wrote:
>
> hi there,
> this is probably already been posted , but cant' find.
> How do you access a Model from within another Model.
>
> Thankyou.
>
>
> >
>


-- 
[web] http://synapsisdi.com.br
[livesets] http://djspark.com.br

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to