1

I add validator to email element:

$usr_email->addValidator('Db_NoRecordExists', true, array('users', 'usr_email'));

And now have error message: A record matching 'admin@example' was found

I want change this error, but I want that will display inserted email

A email 'admin@example' already exist in database I try , but email not disply ant html tags

addErrorMessage("**This email **strong text** address already exist.**");
4

1 回答 1

1

Use %value% placeholder in the error message, it will be replaced with the actual value.

Example:

$usr_email->addValidator('Db_NoRecordExists', true, array(
    'users', 
    'usr_email', 
    'messages' => array(
        'recordFound' => 'A email %value% already exist in database'
    )));
于 2013-07-30T00:06:47.930 回答