20002

Question:
After a form-submit in Kohana, I want the user to go back to the homepage. Is it correct to use a redirect for this?
public function action_edit($id)
{
if (!empty($post))
{
if ($post->validate())
{
$this->request->redirect(Route::get('admin')->uri(array('action' => 'list')));
}
}
}
Thanks in advance!
Answer1:Sometimes $this->request->uri($params)
(instead of Route::get()->uri()
) maybe useful. For example, when you want to use current controller (redirect to another action) or the same route. It will use route params from current request by default.
The redirecting part is indeed correct. The validation part is missing a few lines.