/** * Register a new route * * @param string $routePattern Route pattern * @param \Closure $closure closure * * @return \Chochan\Routing\Route */ public function register($routePattern, \Closure $closure) { $route = new Route($this->getBaseDir() . $routePattern); $route->setClosure($closure); $this->routes[] = $route; return $this->routes[count($this->routes) - 1]; }