Because your app controller is attempting to access the User model.
Models are not loaded by default - only if they are included in the
$uses array of a controller (or, if they are the primary model for the
controller, and there is no $uses).

http://manual.cakephp.org/chapter/controllers


On Nov 29, 12:11 pm, skoggins <[EMAIL PROTECTED]> wrote:
> Thanks.  The first solution worked.  Can anyone help me out with why
> this is necessary?  Also is it supposed to be "$uses"?
>
> Thanks.
>
> On Nov 28, 3:47 pm, "Christopher E. Franklin, Sr."
>
> <[EMAIL PROTECTED]> wrote:
> > In the app_controller.php you must either do var $uses =
> > array('User'); or in the beforeRender() do an App::import('Model',
> > 'User');
>
> > On Nov 28, 3:35 pm, skoggins <[EMAIL PROTECTED]> wrote:
>
> > > Thanks!  beforeRender works but now I get this error:
>
> > > Notice: Undefined property: AppController::$User in C:\accounts
> > > \placeholder\app\app_controller.php on line 48
>
> > > Fatal error: Call to a member function findById() on a non-object in C:
> > > \accounts\placeholder\app\app_controller.php on line 48
>
> > > Any ideas why?
>
> > > On Nov 26, 5:54 pm, Gwoo <[EMAIL PROTECTED]> wrote:
>
> > > > beforeRender is usually better for that stuff than beforeFilter
> > > > because its possible that you are overwriting user somewhere in you
> > > > controllers.- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to