public function setForm() { $this->setAttribute('method', 'post'); $this->setAttribute('role', 'form'); $lbRequired = true; $lbReadOnly = false; if ($this->_sActionType == 'edit') { $lbRequired = false; $lbReadOnly = true; } $this->add(array('name' => 'fromName', 'type' => 'Text', 'attributes' => array('id' => 'fromName', 'placeholder' => 'Seu Nome', 'class' => 'form-control', 'required' => true, 'title' => 'Seu nome', 'size' => '250'), 'options' => array('label' => 'Nome: ', 'for' => 'fromName'))); $this->add(array('name' => 'fromMail', 'type' => 'Email', 'attributes' => array('id' => 'fromMail', 'pattern' => '^[_a-zA-Z0-9-]+(\\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*(\\.[a-zA-Z]{2,4})$', 'placeholder' => 'E-mail de contato', 'class' => 'form-control', 'required' => true, 'title' => 'Seu e-mail para contato', 'size' => '250'), 'options' => array('label' => 'E-mail: ', 'for' => 'fromMail'))); $this->add(array('name' => 'subject', 'type' => 'Text', 'attributes' => array('id' => 'subject', 'class' => 'form-control', 'required' => true, 'title' => '', 'value' => ''), 'options' => array('label' => 'Assunto: ', 'for' => 'subject'))); $this->add(array('name' => 'message', 'type' => 'textarea', 'attributes' => array('id' => 'message', 'placeholder' => 'Escreva sua mensagem aqui', 'class' => 'form-control', 'rows' => 6, 'required' => true, 'title' => ''), 'options' => array('label' => 'Mensagem: ', 'for' => 'message'))); //$loCaptchaImg = new CaptchaImage(); $loCaptchaImg = new Dumb(); $loCaptcha = new Captcha('captcha'); $loCaptcha->setCaptcha($loCaptchaImg); $loCaptcha->setAttributes(array('id' => 'captcha', 'class' => 'form-control', 'required' => false, 'title' => '')); $loCaptcha->setOptions(array('label' => 'Informe os caracteres: ', 'for' => 'captcha')); //$this->add($loCaptcha); //$this->add(new Csrf('security')); $this->add(array('name' => 'submit', 'type' => 'Submit', 'attributes' => array('value' => Translator::i18n('Enviar'), 'id' => 'submit', 'class' => 'btn btn-primary'))); //Load and set the client specific configuration for this form $this->clientSets(); }
public function setForm() { $this->setAttribute('method', 'post'); $this->setAttribute('role', 'form'); $lbRequired = true; $lbReadOnly = false; if ($this->_sActionType == 'edit') { $lbRequired = false; $lbReadOnly = true; } $this->add(array('name' => 'stEmail', 'attributes' => array('id' => 'stEmail', 'type' => 'Email', 'placeholder' => Translator::i18n('E-mail cadastrado'), 'class' => 'form-control noUpper', 'required' => 'required', 'title' => Translator::i18n('E-mail cadastrado')), 'options' => array('label' => Translator::i18n('E-mail') . ': ', 'for' => 'stEmail'))); //$loCaptchaImg = new CaptchaImage(); $loCaptchaImg = new Dumb(); $loCaptcha = new Captcha('captcha'); $loCaptcha->setCaptcha($loCaptchaImg); $loCaptcha->setAttributes(array('id' => 'captcha', 'class' => 'form-control', 'required' => 'required', 'title' => '')); $loCaptcha->setOptions(array('label' => Translator::i18n('Informe os caracteres') . ': ', 'for' => 'captcha')); //$this->add($loCaptcha); $this->add(new Csrf('security')); $this->add(array('name' => 'submit', 'attributes' => array('type' => 'submit', 'value' => Translator::i18n('Enviar'), 'id' => 'submitbutton', 'class' => 'btn btn-primary'))); // Load and set the client specific configuration for this form $this->clientSets(); }