How to add custom link to Yii 2 validation error message?
I would like to add a custom link in a validation confirmation based on Yii 2 model.
I am using the following code at the moment -
public function rules()
{
return [
['email', 'required'],
['email', 'email'],
['email', 'unique', 'targetClass' => '\common\models\User',
'message' => 'Email address has already been taken.'],
];
}
I want this message to be displayed like this:
"Email address is busy. Already registered? Then login here ."
How can I achieve this?
+3
source to share