public function loadController($basePath, $controllerClass, $middleware = null)
    {
        $method_list = get_class_methods($controllerClass);
        $reflector = new \ReflectionClass($controllerClass);
        foreach ($method_list as $method) {
            if (strpos($method, '_') === 0) {
                continue;
            }
            $path = $basePath . $method;
            $parameters = $reflector->getMethod($method)->getParameters();
            $after_string = "";
            $came_in_default_area = false;
            if (!empty($parameters)) {
                //self::ROUTER_TYPE_REGEX
                foreach ($parameters as $param) {
                    if ($param->isDefaultValueAvailable()) {
                        $path .= "(";
                        $after_string .= ")?";
                        $came_in_default_area = true;
                    } elseif ($came_in_default_area) {
                        //non-default after default
                        if ($this->debug) {
                            echo ("ROUTE SETTING ERROR: required-parameter after non-required-parameter") . PHP_EOL;
                        }
                        return;
                    }
                    $path .= '/{' . $param->name . '}';
                }
                $path .= $after_string;
            }
            $this->registerRoute(null, $path, [$controllerClass, $method], $middleware);
            if ($method == $this->default_method_name) {
                $basePathX = $basePath;
                if (strlen($basePathX) > 0) {
                    $basePathX = substr($basePathX, 0, strlen($basePathX) - 1);
                }
                $this->registerRoute(null, $basePathX, [$controllerClass, $method], $middleware);
            }
        }
    }