/** * 路由配置是否存在 * * @param string $name * @return boolean */ public function exists($name) { $path = $this->getPath() . '/' . $name; return $this->files->isDirectory($path) || $this->files->isFile($path . '.php'); }
/** * 给定的控制器是否存在 * * @param string $appName * @param string $controllerName * @return bool */ private function isController($controllerName) { return $this->files->isFile($this->app['path.app'] . '/' . lcfirst($this->app->getAppName()) . '/controllers/' . ucfirst($controllerName) . self::CONTROLLER_PREFIX . '.php'); }