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

protected static method

Copies persistent parameters (parameters in the request which have been designated to persist) to the current URL, unless the parameter has been explicitly disabled from persisting by setting the value in the URL to null, or by assigning some other value.

For example:


Parameters

  • array $url

    The parameters that define the URL to be matched.

  • \lithium\action\Request $context

    A request object, which contains a $persist property, which is an array of keys to be persisted in URLs between requests.

Returns

array

Returns the modified URL array.

Source

	protected static function _persist($url, $context) {
		if (!$context || !isset($context->persist)) {
			return $url;
		}
		foreach ($context->persist as $key) {
			$url += array($key => $context->params[$key]);

			if ($url[$key] === null) {
				unset($url[$key]);
			}
		}
		return $url;
	}