在我的模型中:
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."
));
}
我可以以某种方式取消链接的转义吗?
不知何故,按类型:&#39;逃避&#39; =&GT;在视图中是假的吗?
答案 0 :(得分:1)
要禁用转义错误消息,您需要指定escape =&gt; FormHelper::control()
中的错误选项中的false:
<?=
$this->Form->control("email", [
"label" => "Your email",
"error" => [
"escape" => false
]
])
?>