Zend_Validate_StringLength::getMin PHP Méthode

getMin() public méthode

Returns the min option
public getMin ( ) : integer
Résultat integer
    public function getMin()
    {
        return $this->_min;
    }

Usage Example

 public function init()
 {
     $oTradutor = $this->getTranslator();
     $oBaseUrlHelper = new Zend_View_Helper_BaseUrl();
     $this->setName('formLiberacaoUsuario');
     $this->setAction($oBaseUrlHelper->baseUrl('/default/cadastro-eventual/confirmar'));
     $this->setMethod('post');
     $oElm = $this->createElement('text', 'hash', array('divspan' => 9));
     $oElm->setLabel('Código Verificação:');
     $oElm->setAttrib('class', 'span7');
     $oElm->setRequired(TRUE);
     $oElm->removeDecorator('errors');
     $this->addElement($oElm);
     $oElm = $this->createElement('text', 'cnpjcpf', array('divspan' => 9));
     $oElm->setLabel('CPF / CNPJ:');
     $oElm->setAttrib('class', 'span3 mask-cpf-cnpj');
     $oElm->setAttrib('maxlength', 18);
     $oElm->addValidator(new DBSeller_Validator_CpfCnpj());
     $oElm->addFilter(new Zend_Filter_Digits());
     $oElm->setRequired(TRUE);
     $oElm->removeDecorator('errors');
     $this->addElement($oElm);
     $oValidaTamanhoCampo = new Zend_Validate_StringLength();
     $oValidaTamanhoCampo->setMin('6');
     $sMensagemValidacao = $oTradutor->_(sprintf('Os campos "<b>Senha</b>" e "<b>Confirme a Senha</b>" devem possuir no mínimo %s caracteres.', $oValidaTamanhoCampo->getMin()));
     $oElm = $this->createElement('password', 'senha', array('divspan' => 9));
     $oElm->setLabel('Senha:');
     $oElm->setAttrib('minlength', $oValidaTamanhoCampo->getMin());
     $oElm->addValidator(new Zend_Validate_Identical('senharepetida'));
     $oElm->setAttrib('message-error', $sMensagemValidacao);
     $oElm->setAttrib('class', 'span3');
     $oElm->setRequired(TRUE);
     $oElm->addValidator($oValidaTamanhoCampo);
     $oElm->removeDecorator('errors');
     $this->addElement($oElm);
     $oElm = $this->createElement('password', 'senharepetida', array('divspan' => 10));
     $oElm->setLabel('Confirme a Senha:');
     $oElm->setAttrib('class', 'span3');
     $oElm->setAttrib('minlength', $oValidaTamanhoCampo->getMin());
     $oElm->addValidator(new Zend_Validate_Identical('senha'));
     $oElm->addValidator($oValidaTamanhoCampo);
     $oElm->setRequired(TRUE);
     $oElm->removeDecorator('errors');
     $this->addElement($oElm);
     $this->addDisplayGroup(array('hash', 'cnpjcpf', 'senha', 'senharepetida'), 'dados_liberacao', array('legend' => 'Confirme seu Cadastro'));
     $this->addElement('submit', 'confirmar', array('label' => 'Confirmar', 'style' => 'margin-left:30px', 'buttonType' => Twitter_Bootstrap_Form_Element_Submit::BUTTON_PRIMARY));
 }
All Usage Examples Of Zend_Validate_StringLength::getMin