ummmm... Mark and I are trying to speak your language, but failing... here is my code based on your forum reply and the member page I found in the documentation - i dont think i am getting an error, but i am also not getting any fields in the font end :) - I have also added: Object::useCustomClass( 'Member', 'BetaTesterForm' ); to the _config file
code:
class BetaTesterForm extends Member {
static $db = array(
"Company" => "Text",
"Country" => "Text",
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->insertBefore(new TextField("Company"), "Text");
$fields->insertBefore(new TextField("Country"), "Text");
$fields->removeByName("Firstname");
$fields->removeByName("Surname");
return $fields;
}
function BetaTesterForm() {
return new Form($this, "BetaTesterForm", new FieldSet(
// List the your fields here
new EmailField("Email", "", "Email address..."),
new TextField("Company", "", "Company..."),
new TextField("Country", "", "Country...")
), new FieldSet(
// List the action buttons here
new FormAction("signup", "")
), new RequiredFields(
new EmailField("Email", "", "Email address..."),
new TextField("Company", "", "Company..."),
new TextField("Country", "", "Country...")
));
}
function signup($data, $form) {
$member = new Member();
$form->saveInto($BetaTesterForm);
$member->write();
$member->Groups()->add(2);
Director::redirect('thanks-for-registering/');
}
}
also... I did try to look this up in docs before asking, it's just that dummies like me dont even know that 'Members' exist, so we look up 'adding form fields to admin' which doesn't come up with any results...