If you just need a model in one location do not use $uses, leave it
$uses = array(). Then in the beforeRender you can use App::Import
App::Import('Model','ModelName');
$modelname = new ModelName();
$modelname->find('all');
or
$this->load('ModelName');
$this->ModelName->find('all')
On Feb 14, 6:29 pm, Estevam <[email protected]> wrote:
> I have an contact_controller to send emails, so i dont need a model to
> this controller.
>
> But, at the same time, i set $uses = array(' ModelName') in
> AppController because i execute a method on beforeRender() that uses
> this model. And i need this in all controllers.
>
> The problem is that if i dont have a model to contact_controller, it
> says that is missing a model. But if i set $uses to null on my contact
> controller the method i call inside beforeRender, that depends of the
> model, returns an error.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php