public function init() { $name = $this->getName(); if (null === $name) { $this->setName('contact'); } $this->add(array('name' => 'from', 'type' => 'Zend\\Form\\Element\\Text', 'options' => array('label' => _('From')))); $this->add(array('name' => 'subject', 'type' => 'Zend\\Form\\Element\\Text', 'options' => array('label' => _('Subject')))); $this->add(array('name' => 'body', 'type' => 'Zend\\Form\\Element\\Textarea', 'options' => array('label' => _('Your message')))); $captcha = new Element\Captcha('captcha'); $captcha->setCaptcha($this->captchaAdapter); $captcha->setOptions(array('label' => _('Please verify you are human.'))); $this->add($captcha); $this->add(new Element\Csrf('csrf')); $this->add(array('name' => 'Send', 'type' => 'Zend\\Form\\Element\\Submit', 'attributes' => array('value' => _('Send')))); }