Hi all,
There's a controller:
class PhotosController extends AppController {
var $name = 'Photos';
function index()
{
// I need to call the method getAllUsers() of the Users
Controller here.
}
}
And,
I would make those model functions (it looks like they are query type functions
anyway) and then - so long as the User model is related in some way to the
Photo model - you can access it like this: $users =
$this-Photo-User-getAllUsers(); If the Photo model is not directly related
to the User
: Mon, 11 Apr 2011 15:15:51
To: cake-php@googlegroups.com
Reply-To: cake-php@googlegroups.com
Subject: Re: How to use a function of a controller from another controller
I would make those model functions (it looks like they are query type functions
anyway) and then - so long as the User model
15:15:51
To: cake-php@googlegroups.com
Reply-To: cake-php@googlegroups.com
Subject: Re: How to use a function of a controller from another controller
I would make those model functions (it looks like they are query type
functions anyway) and then - so long as the User model is related
:51
To: cake-php@googlegroups.com
Reply-To: cake-php@googlegroups.com
Subject: Re: How to use a function of a controller from another controller
I would make those model functions (it looks like they are query type
functions anyway) and then - so long as the User model is related in some
way