luya\base\Module::resolveRoute PHP Method

resolveRoute() public method

Extract the current module from the route and return the new resolved route.
public resolveRoute ( string $route ) : string
$route string Route to resolve, e.g. `admin/default/index`
return string
    public function resolveRoute($route)
    {
        $routeParts = explode('/', $route);
        foreach ($routeParts as $k => $v) {
            if ($k == 0 && $v == $this->id || empty($v)) {
                unset($routeParts[$k]);
            }
        }
        if (count($routeParts) == 0) {
            return $this->defaultRoute;
        }
        return implode('/', $routeParts);
    }