Advertisement
Guest User

Untitled

a guest
Oct 28th, 2015
8
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. class ContactPage_Controller extends Page_Controller {
  2.  
  3. private static $allowed_actions = array('Form');
  4. public function Form() {
  5.  
  6. $fields = new FieldList(
  7. new TextField('Naam'),
  8. new EmailField('Email'),
  9. new TextareaField('Bericht')
  10. );
  11.  
  12. $validator = ZenValidator::create();
  13.  
  14. $validator->addRequiredFields(array(
  15. 'Naam' => 'Vul hier uw naam in!',
  16. 'Email' => 'Vul hier uw E-mailadres in!',
  17. 'Bericht' => 'Vul hier uw bericht in!'
  18. ));
  19.  
  20. $actions = new FieldList(
  21. new FormAction('submit', 'Verzenden')
  22. );
  23. return new Form($this, 'Form', $fields, $actions, $validator);
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement