Hi,

another problem with the Db\NoRecordExists validator within an input
filter class. I would like to set an individual message for each of
these validators in my filter classes.

I tried to overwrite the message like this:

------------------------------------------------------------------
class UserFilter extends InputFilter
{
    public function __construct()
    {
        $this->add($this->getFactory()->createInput(array(
            'name'     => 'email',
            'required' => true,
            'filters'  => array(
                array('name' => 'StripTags'),
                array('name' => 'StringTrim'),
            ),
            'validators' => array(
                array(
                    'name'    => 'EmailAddress',
                    'options' => array(
                    ),
                ),
                array(
                    'name'    => 'Db\NoRecordExists',
                    'options' => array(
                        'table'     => 'users',
                        'field'     => 'email',
                        'adapter'   => $this->adapter,
                        'message'   => 'Test message',
                    ),
                ),
            ),
        )));
    }
}
------------------------------------------------------------------

But that did not work. How can I manage to do this?

Regards,

Ralf

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to