Created
August 26, 2013 07:32
-
-
Save paulschwarz/6338862 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
protected function _response_view() | |
{ | |
/** | |
* We can determine the view for each request based on the route | |
* directory/controller/action | |
*/ | |
$directory = $this->request->directory(); | |
$controller = $this->request->controller(); | |
$action = $this->request->action(); | |
// The action has not gone through PSR-0 yet | |
$action = str_replace(' ', '', ucwords(str_replace('_', ' ', $action))); | |
// Removes leading slash if this is not a subdirectory controller | |
$controller_path = trim($directory.'/'.$controller.'/'.$action, '/'); | |
return Kostache::factory('Page/'.$controller_path) | |
->assets(new Assets); | |
} |
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
protected function _response_view() | |
{ | |
/** | |
* We can determine the view for each request based on the route | |
* directory/controller/action | |
*/ | |
$directory = $this->request->directory(); | |
$controller = $this->request->controller(); | |
$action = $this->request->action(); | |
// The action has not gone through PSR-0 yet | |
$action = str_replace(' ', '', ucwords(str_replace('_', ' ', $action))); | |
// Removes leading slash if this is not a subdirectory controller | |
$controller_path = trim($directory.'/'.$controller.'/'.$action, '/'); | |
$view_file = 'Page/'.$controller_path; | |
return (new $view_file)->assets(new Assets); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment