/** * Check if the view has a controller which can be attached * @param string $view The view name * @return mixed A controller instance or false */ protected function getController($view) { foreach ($this->controller->getControllers() as $controller) { if (in_array($view, $controller->getViews())) { return $controller; } } return false; }