Hi, I'm trying to customize login form to tailor HTML to my design.
I added
Object::useCustomClass('MemberLoginForm', 'CustomLoginForm');
to mysite/_config.php.Created CustomLoginForm.php in mysite/code:
class CustomLoginForm extends MemberLoginForm
{
public function __construct($controller, $name)
{
if(!$fields) {
$label=singleton('Member')->fieldLabel(Member::config()->unique_identifier_field);
$fields = new FieldList(
new HiddenField("AuthenticationMethod", null, $this->authenticator_class, $this),
// Regardless of what the unique identifer field is (usually 'Email'), it will be held in the
// 'Email' value, below:
new TextField("Email", $label, Session::get('SessionForms.MemberLoginForm.Email'), null, $this),
new PasswordField("Password", _t('Member.PASSWORD', 'Password'))
);
if(Security::config()->autologin_enabled) {
$fields->push(new CheckboxField(
"Remember",
_t('Member.REMEMBERME', "Remember me next time?")
));
}
}
parent::__construct($controller, $name);
}
}
And copied some stuff from parent class just to make sure it works.
I get
[Warning] Missing argument 1 for CustomLoginForm::__construct()
and I don't know what is going on...