zendframework/zf2 — pull request #2229 by rwrz (2012-08-23 20:22:08+00:00)
Title: Fix problems with Validator\Identical when the form has Fieldsets

Today this validator can't check a identical field if it is in a
fieldset.
Now you can do that passing a token like: 'user[password]' like our
forms names.

An example of usage:

/* In the FORM */

$confirmaSenhaInput = new \Zend\InputFilter\Input('confirm_password');
$confirmaSenhaInput->setRequired(true);
$validatorChain = new \Zend\Validator\ValidatorChain();
$validatorChain->addValidator(new \Zend\Validator\Identical("user[password]"));
$confirmaSenhaInput->setValidatorChain($validatorChain);

/* In the FIELDSET named: USER */

$this->add(array(
'name' => 'password',
'options' => array(
'label' => 'Password*:'
),
'attributes' => array(
'required' => 'required',
'id' => 'password',
)
));