PHP code example of vitorbarros / vmb-zf2-form-fields-validator
1. Go to this page and download the library: Download vitorbarros/vmb-zf2-form-fields-validator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vitorbarros / vmb-zf2-form-fields-validator example snippets
namespace People\Form;
use VMBFormFieldsValidator\Form\FormFilter;
use Zend\Form\Form;
class ClientForm extends Form
{
/**
* ClientForm constructor.
* @param null $name
* @param array $options
*/
public function __construct($name = null, array $options = array())
{
$this->setInputFilter(new FormFilter(array(
//You fill this array with all ' => 'Estado',
'address_zipcode' => 'Cep',
'contact_name' => 'Contato',
'contact_phone_1' => 'Telefone 1',
'client_activity' => 'Atividade',
'operator' => 'Operador responsável'
),
//You only put this array if you need passeord validation
'passwordValidator' => array(
'password' => array(
'name' => 'user_password',
'label' => 'Senha'
),
'confirmation' => array(
'name' => 'user_password_confirm',
'label' => 'Confirmar senha'
)
)
)));
}
}