public function __construct(View $view, Request $request, array $routes, Controller $controller = null, $model = null) { $this->view = $view; $this->request = $request; $this->controller = $controller; $this->model = $model; $this->routes = $routes; $this->viewLocator = $controller !== null ? $controller->getViewLocator() : null; }