Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Forum code question about $form->loadDataFrom($member);

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

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Page: 1
Go to End
Author Topic: 1175 Views
  • dio5
    Avatar
    Community Member
    501 Posts

    Forum code question about $form->loadDataFrom($member); Link to this post

    Looking at the forum code, in ForumMemberProfile.php there are the methods RegistrationForm() and doregister().

    I'm wondering what this is doing in the RegistrationForm() method:

    $member = new Member();
    $form->loadDataFrom($member);

    Not sure what it does and why it is there... Imean I know what the first line does, but the member seems to be created in the doregister()-method anyway, so I can't understand why it is here and why loadDataFrom is needed, and what it is doing...?

    Edit:
    And another question.. sorry :
    a few times in the doregister-method I see

    Director::redirectBack();
    die;

    But sometimes the 'die;' isn't there at all. Neither is 'die' used in the forms tutorial.
    When using this die-function in my form in the same way as in the ForumMemberProfile the redirectback doesn't seem to work either... it just dies before getting the chance to redirect.

    Thanks.

    1175 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.