lithium\net\http\Router::_prefix()
Returns the prefix (scheme + hostname) for a URL based on the passed $options and the
$context.
Parameters
-
string
$pathThe URL to be prefixed.
-
object
$contextThe request context.
-
array
$optionsOptions for generating the proper prefix. Currently accepted values are:
'absolute' => true|false,'host' => stringand'scheme' => string.
Returns
stringThe 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;
}