Skip to content

Instantly share code, notes, and snippets.

@dollardad
Created December 7, 2015 20:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dollardad/b35534394e398a7d4479 to your computer and use it in GitHub Desktop.
Save dollardad/b35534394e398a7d4479 to your computer and use it in GitHub Desktop.
Reviews form
class ReviewForm extends Form {
public function __construct($controller, $name) {
$fields = new FieldList(
TextField::create('Title', 'Title'),
HtmlEditorField::create('ReviewText', 'Write a Review'),
HiddenField::create('MemberID'),
HiddenField::create('NominationID'),
HiddenField::create('ID')
);
$actions = new FieldList(
FormAction::create('submitReview', 'Save')
->addExtraClass('form-submit')
);
$validator = new RequiredFields('Title');
return parent::__construct($controller, $name, $fields, $actions, $validator);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment