The construct requires the field name of the context value if it is an
array. The context value can be provided in the contructor if you
are using the validator by itself or Zend_Filter_Input.
With Zend_Form, the context is handled automatically.
<?php
$password = new Zend_Form_Element_Password('password');
$password->setLabel('Password')
->addValidator(new Zym_Validate_Confirm('password_confirm'));
$passwordConfirm = new Zend_Form_Element_Password('password_confirm');
$passwordConfirm->setLabel('Password Confirm');
Standalone usage is like so:
<?php
// Context value in constructor
$confirm = new Zym_Validate_Confirm('confirm', array('confirm' => 'aValue'));
$isValid = $confirm->isValid('bar');
// Context value in isValid
$confirm = new Zym_Validate_Confirm('confirm');
$isValid = $confirm->isValid('bar', array('confirm' => 'aValue'));