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:
parent
717a755417
commit
e20353d77a
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue