Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Controller
- class ContactUs_Controller extends Page_Controller {
- private static $allowed_actions = array('Form');
- public function Form() {
- // https://docs.silverstripe.org/en/3/developer_guides/forms/how_tos/simple_contact_form/
- $fields = new FieldList(
- new TextField('FirstName', 'Firs tName'),
- new TextField('LastName', 'Last Name'),
- new EmailField('Email', 'Email'),
- new TextareaField('Message', 'Message')
- );
- $actions = new FieldList(
- new FormAction('submit', 'Submit')
- );
- $form = new Form($this, 'Form', $fields, $actions);
- $form->setTemplate('ContactUsFormTemplate');
- return $form;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement