在添加的表单对应的动作中,我想在表单上方显示错误。但是当我写:
if("1" != $error)
{
$this->redirect('@domaine');
}
else
{
$this->getUser()->setFlash('error', "A domain with the same name already exists.");
}
什么也没发生。
但是如果我重定向用户,它会起作用,错误消息会显示。但我不想要。我想留在表单上并在表单上方显示错误消息。
在添加的表单对应的动作中,我想在表单上方显示错误。但是当我写:
if("1" != $error)
{
$this->redirect('@domaine');
}
else
{
$this->getUser()->setFlash('error', "A domain with the same name already exists.");
}
什么也没发生。
但是如果我重定向用户,它会起作用,错误消息会显示。但我不想要。我想留在表单上并在表单上方显示错误消息。