How to use a function of a controller from another controller

2011-04-11 Thread Rishab Jain
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,

Re: How to use a function of a controller from another controller

2011-04-11 Thread Jeremy Burns | Class Outfit
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

Re: How to use a function of a controller from another controller

2011-04-11 Thread jairishab
: 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

Re: How to use a function of a controller from another controller

2011-04-11 Thread Jeremy Burns | Class Outfit
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

Re: How to use a function of a controller from another controller

2011-04-11 Thread mikek
: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