protected function urlAbsPartAndSplitByReverseBasePath (\MvcCore\IRequest & $request, $resultUrl, & $domainParams, $splitUrl) {
		$doubleSlashPos = mb_strpos($resultUrl, '//');
		$doubleSlashPos = $doubleSlashPos === FALSE
			? 0
			: $doubleSlashPos + 2;
		$router = & $this->router;
		$basePathPlaceHolderPos = mb_strpos($resultUrl, static::PLACEHOLDER_BASEPATH, $doubleSlashPos);
		if ($basePathPlaceHolderPos === FALSE) {
			return $this->urlAbsPartAndSplitByRequestedBasePath(
				$request, $resultUrl, $splitUrl
			);
		}
		$pathPart = mb_substr($resultUrl, $basePathPlaceHolderPos + mb_strlen(static::PLACEHOLDER_BASEPATH));
		$pathPart = str_replace('//', '/', $pathPart);
		$basePart = mb_substr($resultUrl, 0, $basePathPlaceHolderPos);
		$basePathParamName = $router::URL_PARAM_BASEPATH;
		$basePart .= isset($domainParams[$basePathParamName])
			? $domainParams[$basePathParamName]
			: $request->GetBasePath();
		if ($this->flags[0] === static::FLAG_SCHEME_ANY)
			$basePart = $request->GetScheme() . $basePart;
		if ($splitUrl) return [$basePart, $pathPart];
		return [$basePart . $pathPart];
	}
protected function urlAbsPartAndSplitByReverseBasePath (\MvcCore\IRequest & $request, $resultUrl, & $domainParams, $splitUrl) {
		$doubleSlashPos = mb_strpos($resultUrl, '//');
		$doubleSlashPos = $doubleSlashPos === FALSE
			? 0
			: $doubleSlashPos + 2;
		$router = & $this->router;
		$basePathPlaceHolderPos = mb_strpos($resultUrl, static::PLACEHOLDER_BASEPATH, $doubleSlashPos);
		if ($basePathPlaceHolderPos === FALSE) {
			return $this->urlAbsPartAndSplitByRequestedBasePath(
				$request, $resultUrl, $splitUrl
			);
		}
		$pathPart = mb_substr($resultUrl, $basePathPlaceHolderPos + mb_strlen(static::PLACEHOLDER_BASEPATH));
		$pathPart = str_replace('//', '/', $pathPart);
		$basePart = mb_substr($resultUrl, 0, $basePathPlaceHolderPos);
		$basePathParamName = $router::URL_PARAM_BASEPATH;
		$basePart .= isset($domainParams[$basePathParamName])
			? $domainParams[$basePathParamName]
			: $request->GetBasePath();
		if ($this->flags[0] === static::FLAG_SCHEME_ANY)
			$basePart = $request->GetScheme() . $basePart;
		if ($splitUrl) return [$basePart, $pathPart];
		return [$basePart . $pathPart];
	}
protected function urlAbsPartAndSplitByReverseBasePath ( \ MvcCore \ IRequest & $ request , $ resultUrl , & $ domainParams , $ splitUrl ) { $ doubleSlashPos = mb_strpos ( $ resultUrl , '//' ) ; $ doubleSlashPos = $ doubleSlashPos === FALSE ? 0 : $ doubleSlashPos + 2 ; $ router = & $ this -> router ; $ basePathPlaceHolderPos = mb_strpos ( $ resultUrl , static :: PLACEHOLDER_BASEPATH , $ doubleSlashPos ) ; if ( $ basePathPlaceHolderPos === FALSE ) { return $ this -> urlAbsPartAndSplitByRequestedBasePath ( $ request , $ resultUrl , $ splitUrl ) ; } $ pathPart = mb_substr ( $ resultUrl , $ basePathPlaceHolderPos + mb_strlen ( static :: PLACEHOLDER_BASEPATH ) ) ; $ pathPart = str_replace ( '//' , '/' , $ pathPart ) ; $ basePart = mb_substr ( $ resultUrl , 0 , $ basePathPlaceHolderPos ) ; $ basePathParamName = $ router :: URL_PARAM_BASEPATH ; $ basePart .= isset ( $ domainParams [ $ basePathParamName ] ) ? $ domainParams [ $ basePathParamName ] : $ request -> GetBasePath ( ) ; if ( $ this -> flags [ 0 ] === static :: FLAG_SCHEME_ANY ) $ basePart = $ request -> GetScheme ( ) . $ basePart ; if ( $ splitUrl ) return [ $ basePart , $ pathPart ] ; return [ $ basePart . $ pathPart ] ; }
After final URL is completed, split result URL into two parts if there
is contained domain part and base path in reverse, what is base material
to complete result URL. If there is found base path percentage
replacement in result url, split url after that percentage replacement
and replace that part with domain param value or request base path value.
@param \MvcCore\IRequest $request
A request object.
@param string			$resultUrl
Result URL to split. Result URL still could
contain domain part or base path replacements.
@param array				$domainParams
Array with params for first URL part (scheme,
domain, base path).
@param bool				$splitUrl
Boolean value about to split completed result URL
into two parts or not. Default is FALSE to return
a string array with only one record - the result
URL. If `TRUE`, result url is split into two
parts and function return array with two items.
@return \string[]		Result URL address in array. If last argument is
`FALSE` by default, this function returns only
single item array with result URL. If last
argument is `TRUE`, function returns result URL
in two parts - domain part with base path and
path part with query string.
After final URL is completed split result URL into two parts if there is contained domain part and base path in reverse what is base material to complete result URL . If there is found base path percentage replacement in result url split url after that percentage replacement and replace that part with domain param value or request base path value .