lithium\net\http\Router::_prepareParams()

protected static method

Prepares URL parameters for matching. Detects and Passes through un-routed URL strings, leaving them untouched.

Will not attempt to parse strings as shorthand parameters but instead interpret them as normal, non-routed URLs when they are prefixed with a known scheme.

Parameters

  • array|string $url

    An array of parameters, shorthand parameter string or URL string.

  • \lithium\action\Request $context
  • array $options

Returns

array|string

Depending on the type of $url either a string or an array.

Source

	protected static function _prepareParams($url, $context, array $options) {
		if (is_string($url)) {
			if (strpos($url, '://') !== false) {
				return $url;
			}
			if (preg_match('%^((#|//)|(mailto|tel|sms|javascript):)%', $url)) {
				return $url;
			}
			if (is_string($url = static::_parseString($url, $context, $options))) {
				return static::_prefix($url, $context, $options);
			}
		}
		$isArray = (
			isset($url[0]) &&
			is_array($params = static::_parseString($url[0], $context, $options))
		);
		if ($isArray) {
			unset($url[0]);
			$url = $params + $url;
		}
		return static::_persist(static::_parseController($url), $context);
	}