Re: Fata error: non-object ?
Problem here is the OP did not tell anyone what the association was so some people have assumed it's a HABTM and others have not and hence we have a lot of conflicting advice :o) 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com 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.
Re: Fata error: non-object ?
Sounds like Cake is trying to interpret this as a join table as part of HABTM (users - details). Try renaming the table/model/controller/views structure to user_details. Jeremy Burns jeremybu...@me.com On 22 Mar 2010, at 00:24, redcat 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com 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. 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com 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.
Re: Fata error: non-object ?
Proper names by Cake conventions: DB table: users_details Model class: UserDetail Model name: UserDetail Model file: user_detail.php Controller class: UsersDetailsController Controller name: UsersDetails Controller class: users_details_controller.php On Mar 22, 6:24 am, redcat la6...@gmail.com 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com 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.
Re: Fata error: non-object ?
@Loboto - Thats wrong. Controller classes would be: UserDetailsController. Only the last word is pluralized, not all of them. On Mar 22, 10:06 am, Dr. Loboto drlob...@gmail.com wrote: Proper names by Cake conventions: DB table: users_details Model class: UserDetail Model name: UserDetail Model file: user_detail.php Controller class: UsersDetailsController Controller name: UsersDetails Controller class: users_details_controller.php On Mar 22, 6:24 am, redcat la6...@gmail.com 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com 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.
Re: Fata error: non-object ?
@Dr. Loboto That's incorrect. Miles J is correct about the controller, but further more: DB table: user_details Model class: UserDetail Model name: UserDetail Model file: user_detail.php Controller class: UserDetailsController Controller name: UserDetails Controller class: user_details_controller.php The only time you pluralize both words is in a HABTM table and its alphabetical order (eg. posts_tags). On Mar 22, 11:06 am, Dr. Loboto drlob...@gmail.com wrote: Proper names by Cake conventions: DB table: users_details Model class: UserDetail Model name: UserDetail Model file: user_detail.php Controller class: UsersDetailsController Controller name: UsersDetails Controller class: users_details_controller.php On Mar 22, 6:24 am, redcat la6...@gmail.com 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com 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.
Re: Fata error: non-object ?
Wouldn't it be var $uses = 'users_details'; ?? On Sun, Mar 21, 2010 at 8:24 PM, redcat la6...@gmail.com 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com 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.
Re: Fata error: non-object ?
Try rename UsersDetails To UserDetails. :) On Mon, Mar 22, 2010 at 6:24 AM, redcat la6...@gmail.com 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor 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. 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 cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com 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.