Glad to help! Incidentally, I already have a few implementations of such validator decorators in the Laboratory here:

http://framework.zend.com/svn/framework/laboratory/library/Zend/Validate/

See the file Array.php, which does exactly what I had mentioned.

Regards,
Bryce Lohr


cvogt wrote:
Hej Bryce,

  
Another, perhaps simpler, approach would be to create an array-aware 
decorator that decorates a validator object with the ability to validate 
arrays. That might be the easiest way to let a scalar-only validator 
automatically validate each element of a given array.
    

you are right, decorators seem to be the way to go. I implemented it this
way and added it as a feature request including code to the issue tracker.

http://framework.zend.com/issues/browse/ZF-4354

Best Regards

Christopher
  

Reply via email to