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

protected static method

Returns the prefix (scheme + hostname) for a URL based on the passed $options and the $context.

Parameters

  • string $path

    The URL to be prefixed.

  • object $context

    The request context.

  • array $options

    Options for generating the proper prefix. Currently accepted values are: 'absolute' => true|false, 'host' => string and 'scheme' => string.

Returns

string

The prefixed URL, depending on the passed options.

Source

	protected static function _prefix($path, $context = null, array $options = []) {
		$defaults = ['scheme' => null, 'host' => null, 'absolute' => false];
		$options += $defaults;
		return ($options['absolute']) ? "{$options['scheme']}{$options['host']}{$path}" : $path;
	}