How can I infer HTML from a Zend validation error?

I am trying to get this Zend Validator to display a link that goes into a reset form. At the moment, it simply displays HTML as text. Any ideas on how to get it to write to a page as HTML?

Thanks!

Here is my code:

protected $_authAdapter; protected $_messageTemplates = array( self::NOT_UNIQUE => 'This email has already been registered! <a href=\'/user/resetpass/\'>Need to reset your password?</a>' ); public function isValid($value, $context=null) { $value = (string) $value; $users = new Users(array('db' => 'tdb')); if($users->userExists($value)){ $this->_error(self::NOT_UNIQUE); return false; } return true; } } 
+6
zend-framework zend-form zend-validate
source share
2 answers

You need to pass the configuration parameter "escape" = false to Zend_Form_Decorator_Errors ().

Basically this one loads automatically, so you should request it.

 $zendelement->getDecorator('Zend_Form_Decorator_Errors')->setOption('escape', false); 
+5
source share

In version 1.7, this is the correct way to access the validator and disable shielding:

$ zendelement-> getDecorator ('Errors') β†’ setOption ('escape', false);

+5
source share

All Articles