Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ContactPage_Controller extends Page_Controller {
- private static $allowed_actions = array('Form');
- public function Form() {
- $fields = new FieldList(
- new TextField('Naam'),
- new EmailField('Email'),
- new TextareaField('Bericht')
- );
- $validator = ZenValidator::create();
- $validator->addRequiredFields(array(
- 'Naam' => 'Vul hier uw naam in!',
- 'Email' => 'Vul hier uw E-mailadres in!',
- 'Bericht' => 'Vul hier uw bericht in!'
- ));
- $actions = new FieldList(
- new FormAction('submit', 'Verzenden')
- );
- return new Form($this, 'Form', $fields, $actions, $validator);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement