Skip to content

Instantly share code, notes, and snippets.

@paulschwarz
Created August 26, 2013 07:32
Show Gist options
  • Save paulschwarz/6338862 to your computer and use it in GitHub Desktop.
Save paulschwarz/6338862 to your computer and use it in GitHub Desktop.
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);
}
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