在我的模型中:
public function buildRules(RulesChecker $rules)
{
return $rules->add($rules->isUnique(
['email'],
"This email is already registered on the site. If it's yours, then you can restore access by clicking on the link <a href='#'>Restore access</a> and follow the instructions."
));
}
我可以以某种方式取消链接的转义吗?
不知何故,按类型:'escape'=> false在视图中?
要禁用转义的错误消息,您需要在FormHelper::control()
中的错误选项中指定escape => false:
<?=
$this->Form->control("email", [
"label" => "Your email",
"error" => [
"escape" => false
]
])
?>