-1

I'm using Kohana framework for my project,I've very lengthy login page.Top of the page shows some static description,contains nearly 200 lines of text, while bottom have sign-up and sign-in forms,when an error occurs the fields will be popup with appropriate error messages,but template loads from top,So user unable to see the error messages.To achieve this how can I redirect user to error div when error occurs ? I'm changing template value as followsif($form_error) $this->template = 'login#error_div'; but its not working

Thanks in advance

4

1 回答 1

0

您需要将用户重定向到带有哈希的页面,而不是将模板的源设置为它,这在这种情况下没有意义。

if ($form_error) {
    $this->request->redirect("whatever#error_div");
}

您可能还想id为您的错误使用更好的方法,也许errors,否则您会将实现细节泄漏到 URL 中而没有任何好处。

于 2012-09-17T10:02:23.113 回答