public function __construct(Presenter $parent = null, $name = null) { parent::__construct($parent, $name); $this->addText('from', 'From')->addRule(Form::EMAIL, 'Please enter a valid email.'); $this->addTextArea('text', 'Message'); $this->addSubmit('btnSend', 'Send')->onClick[] = callback($this, 'FormSent'); }