1
0
Fork 0
mirror of https://github.com/Oreolek/kangana.git synced 2024-05-18 17:08:19 +03:00

Redirect is now more convenient

This commit is contained in:
Alexander Yakovlev 2014-02-16 11:13:01 +07:00
parent 717a755417
commit e20353d77a
2 changed files with 15 additions and 1 deletions

View file

@ -87,9 +87,18 @@ class Controller_Layout extends Controller {
}
if (empty($this->template->errors))
{
$this->redirect(Route::url('default', array('controller' => Request::current()->controller(), 'action' => 'view','id' => $model->id)));
$this->redirect($this->_edit_redirect($model));
}
}
$this->template->model = $model;
}
/**
* Where to redirect after successful model editing.
* @param ORM $model
**/
protected function _edit_redirect($model)
{
return Route::url('default', array('controller' => Request::current()->controller(),'action' => 'view','id' => $model->id));
}
}

View file

@ -38,6 +38,11 @@ class Controller_Letter extends Controller_Layout {
}
$this->_edit($model);
}
protected function _edit_redirect($model)
{
return Route::url('default', array('controller' => 'Course','action' => 'view','id' => $model->course_id));
}
public function action_delete()
{