I have the below code on handling 2 actions (Save, Save & Add New),
if ($btn == 'Save & Add New') {
return $this->redirect(['xx-xx']);
} else {
return $this->redirect(['index']);
}
When I click save, I execute the below code
return $this->redirect(['index']);
it does not redirect? but the redirection works for "xx-xx""
Pasman
(Pasman P)
2
show more code.
maybe better is to redirect after saving.
n099y
(J King78)
3
Try this, you normally add the controller.
return $this->redirect(['site/index']);