Details
-
Type:
New Feature
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 1.9.3
-
Fix Version/s: 1.10.0
-
Component/s: Zend_Validate
-
Labels:None
-
Tags:
Description
It would be great to have a series of context sensitive validators.
Since the context isn't supported by regular validation chains, and used mainly by forms, maybe they should be under Zend_Form_Validate instead to reduce confusion, or does that just make it worse?
Some useful validators that would be great if they had context sensitive alternatives:
Db_RecordExists
Db_NoRecordExists
Between
GreaterThan
LessThan
Identical
NotEmpty
Regex
Let me know if this should go through the proposal process instead.
No, this is nonsense.
Validators themself should not take care of context. Context is only a way of Zend_Form to prevent problems on actual API of Zend_Form.
What should a identical validator for example to with a context ?
Identical means that token and value are 100% identical. A context would only be usefull when it has to check only a part, which means that it would then no longer be identical but only partitial. Same goes for other validators.
And we can not add context to the interface as this would mean that all validators can not be used standalone anymore, or have problems when you change Zend_Forms API or extend it with a own implementation.
Actually there is already a proposal which aims to solve this problem because context was added a few months ago to Zend_Form.