Permalink
Browse files

Allowing redirects from init()

  • Loading branch information...
Daniel Khalil
Daniel Khalil committed Apr 2, 2013
1 parent 15cbb70 commit e2a4f6dd26812a8dc8e1c27d9f2512b6dbf8a3c9
Showing with 6 additions and 4 deletions.
  1. +6 −4 lib/Bacon/Controller.php
@@ -99,12 +99,14 @@ public function call($options)
$this->handle_upload();
}
$this->init();
try {
$result = $this->init();
$action_name = $options->action == 'new' ? '_new' : $options->action;
if (get_class($result) != '\\Bacon\\Presenter\\Redirect') {
$action_name = $options->action == 'new' ? '_new' : $options->action;
try {
$result = $this->$action_name();
$result = $this->$action_name();
}
return A([
'data' => $result,

0 comments on commit e2a4f6d

Please sign in to comment.