@param string $routeController

@return string
199633
private function guessControllerClass($routeController)
    {
        $temp = explode(':', $routeController);
        if (3 === count($temp)) {
            $controllerClass = $temp[0];
        } else {
            $controllerClass = get_class($this->container->get($temp[0]));
        }

        return $controllerClass;
    }
1160379
public function getControllerFromRoute(Route $route)
    {
        $ret = false;
        $actionParts = explode(':', $route->getDefault('_controller'));

        if (count($actionParts) == 2) {
            $ret = $this->container->get($actionParts[0]);
        }

        return $ret;
    }
926280
protected function controllerPath($s)
    {
        $s = strtr($s, ':', '.');
        $s = preg_replace('#([^.])(?=[A-Z])#', '$1-', $s);
        $s = strtolower($s);
        $s = rawurlencode($s);

        return $s;
    }
635183
public function getLink($controller, $params = array(), $fullPath = false)
    {
        if ($controller instanceof Controller) {
            $controller = get_class($controller);
        }
        $controller = (string)$controller;
        if(substr($controller, 0, 1) === "\\") {
            $controller = substr($controller, 1);
        }
        try {

            $url = Bootstrap::getSingleton()->getManager()->getRouter()->generate($controller, $params);
            if ($fullPath) {
                $protocol = 'http';
                if (strpos($_SERVER['SCRIPT_URI'], 'https') !== false) {
                    $protocol = 'https';
                }
                return $protocol . '://' . $_SERVER['HTTP_HOST'] . $url;
            }
            return $url;
        } catch (\Exception $ex) {

        }
        return "";
    }
1251207
public static function resource($url, $controller)
    {
        $route = new self($url);

        $route->targets = ['index', 'show', 'insert', 'add', 'update', 'edit', 'delete'];

        $route->setResourceMethods($url, $controller);

        return $route;
    }
1181438
public function getController($router, $request)
    {
        $xml = new \DOMDocument;
        $routes = Config::getInstance()->get('routes');
        
        foreach ($routes as $route) {
            $router->addRoute($route);
            unset($route);
        }

        try {
            $matchedRoute = $router->getRoute($request->getUri()->getPath());
        } catch (\RuntimeException $e) {
            if ($e->getCode() == \phpGone\Router\Routeur::NO_ROUTE) {
                return null; //Permet de passer au middleware suivant
            }
        }

        $_GET = array_merge($_GET, $matchedRoute->getMatches());

        $controllerClass = $matchedRoute->getController();
                            
        return new $controllerClass($matchedRoute, $request);
    }
1221365
protected function getRoute($controller)
    {
        $routes = $this->router->getRouteCollection()->all();
        foreach ($routes as $name => $route) {
            if ($controller === $route->getDefault('_controller')) {
                return [ $name, $route ];
            }
        }

        return null;
    }
979651
public function getUrl(
        $module = self::DEFAULT_MODULE,
        $controller = self::DEFAULT_CONTROLLER,
        array $params = []
    ): string {
        $module = $module ?? Request::getModule();
        $controller = $controller ?? Request::getController();

        if (isset($this->reverse[$module], $this->reverse[$module][$controller])) {
            return $this->urlCustom($module, $controller, $params);
        }

        return $this->urlRoute($module, $controller, $params);
    }
1343533
public function getController($route = null)
		{
		    $router = $this->init($route == null)->router;
			return $route
                ? $router->getController($route)
                : $router->getControllers();
		}
1242960
private function getPartsFromControllerName($controller)
    {
        if (3 != count($parts = explode(':', $controller))) {
            throw new \InvalidArgumentException(sprintf('The "%s" controller is not a valid a:b:c controller string.', $controller));
        }

        list($moduleName, $controller, $action) = $parts;
        $controller = str_replace('/', '\\', $controller);
        $module     = $this->moduleManager->getModule($moduleName);

        if (!is_object($module)) {
            throw new \RuntimeException(sprintf(
                'Unable to locate module: %s, when parsing controller: %s',
                $moduleName, $controller
            ));
        }

        $moduleName = $module->getName();

        return [$module, $moduleName, $controller, $action];
    }
1313575
protected function searchController(
        /*# string */ $controller,
        /*# string */ $action
    )/*# : callable */ {
        $controllerName = $controller . $this->controller_suffix;
        $actionName = $action . $this->action_suffix;
        foreach ($this->namespaces as $ns) {
            $class = $ns . '\\' . $controllerName;
            if (class_exists($class)) {
                $obj = new $class();
                return [$obj, $actionName];
            }
        }
        throw new LogicException(
            Message::get(Message::RTE_HANDLER_UNKNOWN, $controller),
            Message::RTE_HANDLER_UNKNOWN
        );
    }
549388
public function generateUrl(array $routeParameters = []): string
    {
        $url = $this->getUrl();
        $url = \preg_replace('/\{(\w+?):(.+?)\}/', '{$1}', $url);
        foreach ($routeParameters as $parameter => $value) {
            $url = \str_replace('{' . $parameter . '}', $value, $url);
        }

        return $url;
    }
760614
protected function getRoutesContent()
    {
        if (!$stub = $this->getRoutesStub()) {
            return '';
        }

        return strtr($stub, array_merge($this->getCommonReplacements(), [
            '{{baseUrl}}'    => implode('/', $this->sectionSegments),
            '{{controller}}' => implode('\\', $this->sectionSegmentsStudly).'Controller',
        ]));
    }
1002778
private function generateRouteName(Route $route): string
    {
        $methods = implode('_', $route->getMethods()).'_';

        $routeName = $methods.$route->getPath();
        $routeName = str_replace(['/', ':', '|', '-'], '_', $routeName);
        $routeName = preg_replace('/[^a-z0-9A-Z_.]+/', '', $routeName);

        // Collapse consecutive underscores down into a single underscore.
        $routeName = preg_replace('/_+/', '_', $routeName);

        return $routeName;
    }
1269873
private function prepare($controller, $template, array $vars)
    {
        $varCount = $this->getVarCount($template);
        $currentCount = count($vars);

        $template = str_replace(self::ROUTE_PARAM_VAR, '%s', $template);
        return vsprintf($template, $vars);
    }
1261595
public function routeController($controller): Controller
    {
        $actions = $this->getActions();

        foreach ($actions as $key => $action) {
            $method = ucfirst(Inflector::pathAction($action));

            if (method_exists($this, 'set' . $method . 'Route')) {
                $this->{'set' . $method . 'Route'}(Inflector::deCamelize($controller), $action);
            }
        }

        $this->mapRoute();

        return $this;
    }
82705
public function guessTemplateName($controller, Request $request)
    {
        if (\is_object($controller) && method_exists($controller, '__invoke')) {
            $controller = [$controller, '__invoke'];
        } elseif (!\is_array($controller)) {
            throw new \InvalidArgumentException(sprintf('First argument of %s must be an array callable or an object defining the magic method __invoke. "%s" given.', __METHOD__, \gettype($controller)));
        }

        $className = $this->getRealClass(\get_class($controller[0]));

        $matchController = null;
        foreach ($this->controllerPatterns as $pattern) {
            if (preg_match($pattern, $className, $tempMatch)) {
                $matchController = str_replace('\\', '/', strtolower(preg_replace('/([a-z\d])([A-Z])/', '\\1_\\2', $tempMatch[1])));
                break;
            }
        }
        if (null === $matchController) {
            throw new \InvalidArgumentException(sprintf('The "%s" class does not look like a controller class (its FQN must match one of the following regexps: "%s")', \get_class($controller[0]), implode('", "', $this->controllerPatterns)));
        }

        if ('__invoke' === $controller[1]) {
            $matchAction = $matchController;
            $matchController = null;
        } else {
            $matchAction = preg_replace('/Action$/', '', $controller[1]);
        }

        $matchAction = strtolower(preg_replace('/([a-z\d])([A-Z])/', '\\1_\\2', $matchAction));
        $bundleName = $this->getBundleForClass($className);

        return sprintf(($bundleName ? '@'.$bundleName.'/' : '').$matchController.($matchController ? '/' : '').$matchAction.'.'.$request->getRequestFormat().'.twig');
    }