Created
April 2, 2014 14:01
-
-
Save asgrim/9934756 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// gumf at the top | |
class Foo extends AbstractActionController | |
{ | |
public function someCommonLogic() | |
{ | |
if ($something) { | |
return $this->redirect()->toRoute('someRoute'); | |
} | |
// some logic to populate some $viewModel thing | |
return $viewModel; | |
} | |
public function myAction() | |
{ | |
$vm = $this->someCommonLogic(); | |
if ($vm->isRedirect()) | |
{ | |
return $vm; | |
} | |
// other logic | |
return $vm; | |
} | |
public function anotherAction() | |
{ | |
$vm = $this->someCommonLogic(); | |
if ($vm->isRedirect()) | |
{ | |
return $vm; | |
} | |
// other logic | |
return $vm; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment