public function index(Request $request, View $view) { $response = $view->show($request); if (!$response instanceof Response) { $response = new Response(Helper::stringify($response)); } return $response; }
public function addView($name, View $view, $route = null) { if ($route === null) { $route = $name . '/'; } if (is_string($route)) { $route = new Route($route); } $view->setParentAndRoute($this, $route); $this->subviews[$name] = $view; }