Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo

Form Error - Trying to get property of non-object


Go to End
Reply


3 Posts   1262 Views

Avatar
Josh

SilverStripe Developer, 65 Posts

18 June 2008 at 11:36am

Just trying to code up a form that returns a users details from the database. Keep getting the following error when trying to run the linked code:

Trying to get property of non-object in /Applications/MAMP/localhost/silverstripe/mysite/code/UserInfoPage.php on line 33

Code
http://pastebin.com/m249278a

Pointers greatly appreciated!

Avatar
Willr

Forum Moderator, 5521 Posts

18 June 2008 at 6:25pm

I dont think that will work. If Im correct you have a email field and on submit you want to get the users details? $this->Form-Email wont work but you could try

   function GetUserDetails($data, $form) {
         $email = $data['Email'];
         // do crazy stuff
         return;
   }

Avatar
Josh

SilverStripe Developer, 65 Posts

18 June 2008 at 7:11pm

Thank You!