我试图让这个Zend Validator输出一个转到resetpass表单的链接.目前,它只是将
HTML作为文本输出.有关如何将其作为HTML写入页面的任何想法?
谢谢!
这是我的代码:
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;
}
}
您必须将配置选项’escape’= false传递给Zend_Form_Decorator_Errors().
通常这个是自动加载的,所以你必须要求它.
$zendelement->getDecorator('Zend_Form_Decorator_Errors')->setoption('escape',false);