Jump to:

5538 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Ragistation form create but admin page have problem

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

Page: 1
Go to End
Author Topic: 1095 Views
  • amarbhanu
    Community Member
    57 Posts

    Ragistation form create but admin page have problem Link to this post

    i used help for coding

    and code is :
    class RegistrationForm extends Page {

    class RegistrationForm_Controller extends Page_Controller {

       private $defaultGroupID = 2;

       * This function lets you put a form on your page, using $Form.
       function Form() {
          return new Form($this, "Form", new FieldSet(

             // List your fields here
             new TextField("FirstName", "First name"),
             new TextField("Surname"),
             new EmailField("Email", "Email address")

          ), new FieldSet(

             // List the action buttons here
             new FormAction("SignupAction", "Sign up")

          ), new RequiredFields(

             // List the required fields here: "Email", "FirstName"


       * This function is called when the user submits the form.
       function SignupAction($data, $form) {

          // Create a new Member object and load the form data into it
          $member = new Member();

          // Write it to the database. This needs to happen before we add it to a group

          // Add the member to group. (Check if it exists first)
          if($group = DataObject::get_one('Group', "ID = $this->defaultGroupID")) {

             // Redirect to a page thanking people for registering


             // Redirect to a failure page



    i have two problem:
    1. dropdown list create problem.
    2. data base have data but how to access this data.

    i haven't any idea so please help me and send some help of links and suggestion please send....

  • Willr
    Forum Moderator
    5497 Posts

    Re: Ragistation form create but admin page have problem Link to this post

    You can view Members in the Security Section in the CMS.

    If you want to get a list of Members on the site you just need to DataObject::get('Member');

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.