Returns the model slug for a model route name segment.

@param string $nameSegment
@return string
17586
protected function getModelSlugForRouteNameSegment($nameSegment)
    {
        $dotPosition = strpos($nameSegment, '.');

        if (false === $dotPosition) {
            return $nameSegment;
        }

        return substr($nameSegment, 0, $dotPosition);
    }
897683
private function getGroupControllerNamespace() : string
    {
        $controllerNamespace = '';

        foreach ($this->groupOptionsStack as $groupOptions) {
            if (isset($groupOptions['controllerNamespace'])) {
                // Add trailing slashes if they're not there already
                if (mb_substr($groupOptions['controllerNamespace'], -1) !== '\\') {
                    $groupOptions['controllerNamespace'] .= '\\';
                }

                $controllerNamespace .= $groupOptions['controllerNamespace'];
            }
        }

        return $controllerNamespace;
    }
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',
        ]));
    }
1306142
protected function findSegmentForReference($name, AbstractSegment $reference)
    {
        $segments = $this->findSegments($name);
        foreach ($segments as $seg) {
            $segSplit = $this->splitSegment($seg);
            $segSplit = array_shift($segSplit);
            $segSplit = $this->splitDeg($segSplit);
            if ($segSplit[3] == $reference->getSegmentNumber()) {
                return $seg;
            }
        }

        return null;
    }
1043975
protected function getSessionSegment(
        Request $request,
        string $name
    ) : Session\SegmentInterface {
        $session = $this->getSession($request);
        return $session->getSegment($name);
    }
735598
public function getSegments() {

            if(!isset($this->segments))
                $this->segments = explode('/', $this->path);

            return $this->segments;

        }
506217
public function getRoutePathForModelClass($modelClass, $prefix = false)
    {
        $modelSlug = $this->getRouteSlugForModelClass($modelClass);

        if ( ! $prefix) {
            return $modelSlug;
        }

        return config('cms-core.route.prefix')
             . config('cms-models.route.prefix') . '/'
             . $modelSlug;
    }
1163210
function aliasGetName($nameOrAlias) {
    if ('\\' === $nameOrAlias[0]) {
      return substr($nameOrAlias, 1);
    }
    elseif (NULL !== $this->namespaceName) {
      return $this->namespaceName . '\\' . $nameOrAlias;
    }
    else {
      return $nameOrAlias;
    }
  }
173850
protected function lookForExistingURLSegment($urlSegment, $id) {
        return $this->owner->get()->filter(
            'URLSegment', $urlSegment
        )->exclude('ID', is_null($id) ? 0 : $id)->exists();
    }
1226645
public function new_route_controller( $namespace ) {
		// Do we want to auto start our controllers?
		if ( $this->config['routing']['auto_start_controllers'] ) {
			// Let's get our class name from the namespace
			$name_parts = explode( '/', $namespace ); 

			// Let's convert our url endpoint name to a legit classname
			$name_parts = array_map(
				function( $string ) {
					$string = str_replace( '-', '_', $string ); // Turn all hyphens to underscores
					$string = str_replace( '_', ' ', $string ); // Turn all underscores to spaces (for easy casing)
					$string = ucwords( $string ); // Uppercase each first letter of each "word"
					$string = str_replace( ' ', '', $string ); // Remove spaces. BOOM! Zend-compatible camel casing

					return $string;
				},
				$name_parts
			);

			// Create a callable classname
			$classname = implode( '\\', $name_parts );
			$class = $this->config['routing']['controller_base_namespace'] . $classname;

			// Does the class exist? (Autoload it if its not loaded/included yet)
			if ( class_exists( $class, true ) ) {
				// Instanciate the controller and keep an easy reference to it
				$this->controller = new $class( $this->request, $this->response, $this->service, $this );
			}
		}

		return null;
	}
1125762
public function getUrlParamList($sPageCode, $sComponentName, $sParamName = 'slug')
    {
        $sCacheKey = implode('_', [$sPageCode, $sComponentName, $sParamName]);
        if ($this->hasCache($sCacheKey)) {
            return $this->getCachedData($sCacheKey);
        }

        $arResult = [];
        if (empty($sPageCode) || empty($sComponentName) || empty($sParamName)) {
            return $arResult;
        }

        //Get component list
        $arComponentList = $this->getFullComponentList($sPageCode);
        if (empty($arComponentList)) {
            return $arResult;
        }

        foreach ($arComponentList as $sKey => $arPropertyList) {
            if (!preg_match('%^'.$sComponentName.'%', $sKey)) {
                continue;
            }

            if (empty($arPropertyList) || !isset($arPropertyList[$sParamName])) {
                continue;
            }

            /*
             * Extract the routing parameter name
             * eg: {{ :someRouteParam }}
             */
            if (!preg_match('/^\{\{([^\}]+)\}\}$/', $arPropertyList['slug'], $arMatches)) {
                continue;
            }

            $sValue = trim($arMatches[1]);
            $sValue = ltrim($sValue, ':');
            $arResult[] = $sValue;
        }

        $this->setCachedData($sCacheKey, $arResult);

        return $arResult;
    }
215761
protected function pathFromParsedUrl($parsedUrl)
    {
        $path = '/' . implode('/', $parsedUrl['segments']);
        if ($parsedUrl['query']) {
            $path .= "?{$parsedUrl['query']}";
        }
        if ($parsedUrl['fragment']) {
            $path .= "#{$parsedUrl['fragment']}";
        }
        return $path;
    }
179457
public function getFullPathAttribute()
    {
        $pathSections = explode('/', $this->getFullPath());

        $slugsToExclude = array_wrap($this->domainMappedFolders);

        $finalSlug = collect($pathSections)
            ->filter()
            ->reject(function ($slug) use ($slugsToExclude) {
                return in_array($slug, $slugsToExclude);
            })
            ->implode('/');

        return str_start($finalSlug, '/');
    }
501699
private function getPath($name)
    {
        if (!isset($this->paths[$name])) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Unknown path segment name "%s", known paths are "%s"',
                    $name,
                    implode('", "', array_keys($this->paths))
                )
            );
        }

        $name = $this->paths[$name];

        return $name;
    }
72216
public function GetCategoryPathAsString($sSeparator = '/')
    {
        $sKey = 'sCatPathCache'.$sSeparator;

        $sPath = $this->GetFromInternalCache($sKey);
        if (is_null($sPath)) {
            $sPath = '';
            $oParent = &$this->GetParent();
            if ($oParent) {
                $sPath = $oParent->GetCategoryPathAsString($sSeparator);
            }
            if (!empty($sPath)) {
                $sPath .= $sSeparator;
            }
            $sPath .= $this->GetName();
            $this->SetInternalCache($sKey, $sPath);
        }

        return $sPath;
    }
1311179
public function getNamedUrl($name, $params = array(), $version = null, $locale = null)
    {
        if ($version == null) {
            $version = Registry::get('version');
        }
        if ($locale == null) {
            $locale = Registry::get('locale');
        }
        $foundRoute = false;
        if (isset($this->allRoutesByVersionAndLocale[$version][$locale][$name])) {
            $url = $this->allRoutesByVersionAndLocale[$version][$locale][$name]['regexp'];
            $foundRoute = true;
        } elseif (isset($this->allRoutesByVersionAndLocale[$version]['*'][$name])) {
            $url = $this->allRoutesByVersionAndLocale[$version]['*'][$name]['regexp'];
            $foundRoute = true;
        } elseif (isset($this->allRoutesByVersionAndLocale['*']['*'][$name])) {
            $url = $this->allRoutesByVersionAndLocale['*']['*'][$name]['regexp'];
            $foundRoute = true;
        }
        if ($foundRoute) {
            preg_match_all('/\(([\w_]+):([^)]+)\)/im', $url, $result, PREG_SET_ORDER);
            for ($matchi = 0; $matchi < count($result); $matchi ++) {
                if (isset($params[$result[$matchi][1]])) {
                    $url = str_replace($result[$matchi][0], $params[$result[$matchi][1]], $url);
                }
            }
            return $url;
        } else {
            throw new \Exception('Cannot find route named "' . $name . '" (version=' . $version . ', locale=' . $locale . ')');
        }
    }
996278
public function ProfileLink($urlSegment)
    {
        $baseLink = $this->Link();
        if ($baseLink === '/') {
            // Handle homepage blogs
            $baseLink = RootURLController::get_homepage_link();
        }

        return Controller::join_links($baseLink, 'profile', $urlSegment);
    }