On Thu, Aug 29, 2013 at 9:00 AM, Marc Tempelmeier <[email protected]> wrote: > i want to change a validator I set in a inputfilter parent class. > > I´ll do that with: > > $validators = > $this->get('main')->get('username')->getValidatorChain()->getValidators(); > > $validators[2]['instance']->setOptions( > array( > 'pattern' => '/^[@a-zA-Z0-9_-]+$/', > ) > ); > > I know there is a plugin-Method on the validator chain, but that returns a > new instance. Is there a better way to do that?
That's the only way currently to do it, though I'd do it slightly differently: loop through the validators and compare them via "instanceof" to ensure you operate only on the correct type of validator. -- Matthew Weier O'Phinney Project Lead | [email protected] Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc -- List: [email protected] Info: http://framework.zend.com/archives Unsubscribe: [email protected]
