Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

/dev/build and admin don't work with new pagetype


Go to End


2 Posts   1341 Views

Avatar
Gusarin

Community Member, 1 Post

18 August 2014 at 1:56am

Hi everybody,

I'm working on a little Contact-Form for a Website - normaly not such a hard thing.
When I load up my php-file /dev/build stops after the page-Point and the CMS-Interface returns a white screen instead of the Interface.
I didn't get any error-messages, also in dev-Mode.

By testing I found out that the error, (if it is based on my code) should be here:

class MailPage_Controller extends Page_Controller{

private static $allowed_actions = array('contactForm');

public funktion contactForm(){

$fields = new FieldList(new EmailField('Mail','Mail*'), new TextField('Betreff', 'Betreff*'), new TextareaField('Nachricht','Nachricht*'));
$actions= new FieldList( new FormAction('sendMail', 'Abschicken'));
$validator = new RequiredFields('Mail','Betreff','Nachricht');
return new Form($this, 'contactForm', $fields, $actions, $validator);
}
}

Thanks for help.

Avatar
Bogoed Shamansky

Community Member, 12 Posts

22 October 2014 at 12:26am

 public funktion contactForm(){ 

must be
 public function contactForm(){