Wouldn't it be

var $uses = 'users_details';

??

On Sun, Mar 21, 2010 at 8:24 PM, redcat <[email protected]> wrote:

> I have a database table called users_details
> I have a model file called UserDetail.php with the following lines:
>
> <?php
> class UserDetail extends AppModel {
>   var $name='UserDetail';
>   var $useTable='users_details';
>   }
> ?>
>
>
>
> I have a controller file called users_details_controller.php with the
> following lines:
> <?php
> class UsersDetailsController extends AppController {
>     var $name = 'Users_Details';
>     function listusers() {
>         $this->set('users_details', $this->UserDetail-
> >find('all'));
>                     }
> }
> ?>
>
> When I go to /app/user_details/listusers I get the following error:
>
> Fatal error: Call to a member function find() on a non-object in /
> cakephp/app/controllers/users_details_controller.php on line 5
>
>
> Notice (8): Undefined property: UsersDetailsController::$UserDetail
> [APP/controllers/users_details_controller.php, line 5]
>
> Now UserDetail model is there - I have even tried to use the variable
> useTable as you can see above.. yet why do I get this error of
> UserDetail being a "non-object"???
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
> To unsubscribe from this group, send email to cake-php+
> unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> ME" as the subject.
>



-- 
Please visit http://freecupidreport.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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

To unsubscribe from this group, send email to 
cake-php+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.

Reply via email to