I created this custom form and put it in mysite/code and named it NewRegistrationForm.php
class NewRegistrationForm extends Form {
public function __construct($controller, $name) {
$fields = new FieldList(
EmailField::create("Email"),
PasswordField::create("Password")
);
$actions = new FieldList(FormAction::create("login")->setTitle("Log in"));
parent::__construct($controller, $name, $fields, $actions);
}
public function login(array $data, Form $form) {
// Do something with $data
Controller::curr()->redirectBack();
}
public function forTemplate() {
return $this->renderWith(array($this->class, 'Form'));
}
}
When i did a ?flush=1, it did not flush properly and displayed this PHP error:
Fatal error: Class 'FieldList' not found in <omitted full path here>mysite/code/NewRegistrationForm.php on line 6
Am i missing something?