예제 #1
0
 public function index(Request $request, View $view)
 {
     $response = $view->show($request);
     if (!$response instanceof Response) {
         $response = new Response(Helper::stringify($response));
     }
     return $response;
 }
예제 #2
0
 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;
 }