zendframework/zf2 — pull request #3844 by wryck7 (2013-02-21 04:37:12+00:00)
Title: Added new option to fix a little issue originated from last PR

After I sent [this PR](https://github.com/zendframework/zf2/pull/3803), I realised a little problem:
When identical validator is used in a form scope, the form will always provide a context, because of this, it wouldn't be possible to validate a `literal` token, see the example.

```PHP
use Zend\Form\Form;
use Zend\InputFilter\InputFilter;

$form = new Form('form');
$form->add(array(
'name' => 'humanCheck',
'options' => array(
'label' => 'How much is 1 + 2?',
),
));

$inputFilter = new InputFilter();
$inputFilter->add(array(
'name' => 'humanCheck',
'required' => true,
'validators' => array(
array(
'name' => 'Identical',
'options' => array(
'token' => '3',
),
),
),
));

$form->setInputFilter($inputFilter);
...
```

This would not work because on validation the validator would try to find `'3'` in the context, and then rise an exception when it doesn't find it.

To solve this I add a new option, `literal`. Setting this to true (it's false by default) would allow a 'literal' validation even when the context is provided. So the above input filter would look like this:
```PHP
$inputFilter->add(array(
'name' => 'humanCheck',
'required' => true,
'validators' => array(
array(
'name' => 'Identical',
'options' => array(
'literal' => true,
'token' => '3',
),
),
),
));
```
This would tell the validator to skip the look up in the context and just use the string `'3'`.
***Note: this option has no affect when context is not provided.***