PHP 클래스 Illuminate\Routing\UrlGenerator

파일 보기 프로젝트 열기: illuminate/routing 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$cachedRoot string | null A cached copy of the URL root for the current request.
$cachedSchema string | null A cached copy of the URL schema for the current request.
$dontEncode array Characters that should not be URL encoded.
$forceSchema string The forced schema for URLs.
$forcedRoot string The forced URL root.
$formatHostUsing Closure The callback to use to format hosts.
$formatPathUsing Closure The callback to use to format paths.
$request Illuminate\Http\Request The request instance.
$rootNamespace string The root namespace being applied to controller actions.
$routes Illuminate\Routing\RouteCollection The route collection.
$sessionResolver callable The session resolver callable.

공개 메소드들

메소드 설명
__construct ( RouteCollection $routes, Illuminate\Http\Request $request ) : void Create a new URL Generator instance.
action ( string $action, mixed $parameters = [], boolean $absolute = true ) : string Get the URL to a controller action.
asset ( string $path, boolean | null $secure = null ) : string Generate the URL to an application asset.
assetFrom ( string $root, string $path, boolean | null $secure = null ) : string Generate the URL to an asset from a custom root domain such as CDN, etc.
current ( ) : string Get the current URL for the request.
forceRootUrl ( string $root ) : void Set the forced root URL.
forceSchema ( string $schema ) : void Force the schema for URLs.
formatHostUsing ( Closur\Closure $callback ) Set a callback to be used to format the host of generated URLs.
formatPathUsing ( Closur\Closure $callback ) Set a callback to be used to format the path of generated URLs.
full ( ) : string Get the full URL for the current request.
getRequest ( ) : Illuminate\Http\Request Get the request instance.
isValidUrl ( string $path ) : boolean Determine if the given path is a valid URL.
pathFormatter ( ) : Closure Get the path formatter being used by the URL generator.
previous ( mixed $fallback = false ) : string Get the URL for the previous request.
route ( string $name, mixed $parameters = [], boolean $absolute = true ) : string Get the URL to a named route.
secure ( string $path, array $parameters = [] ) : string Generate a secure, absolute URL to the given path.
secureAsset ( string $path ) : string Generate the URL to a secure asset.
setRequest ( Illuminate\Http\Request $request ) : void Set the current request instance.
setRootControllerNamespace ( string $rootNamespace ) Set the root controller namespace.
setRoutes ( RouteCollection $routes ) Set the route collection.
setSessionResolver ( callable $sessionResolver ) Set the session resolver for the generator.
to ( string $path, mixed $extra = [], boolean | null $secure = null ) : string Generate an absolute URL to the given path.

보호된 메소드들

메소드 설명
addPortToDomain ( string $domain ) : string Add the port to the domain if necessary.
addQueryString ( string $uri, array $parameters ) : mixed | string Add a query string to the URI.
buildCompleteUrl ( string $root, string $path, string $tail = '' ) : string Format the given URL segments into a single URL.
formatDomain ( Illuminate\Routing\Route $route, array &$parameters ) : string Format the domain and port for the route and request.
formatParameters ( mixed | array $parameters ) : array Format the array of URL parameters.
getDomainAndScheme ( Illuminate\Routing\Route $route ) : string Get the domain and scheme for the route.
getNumericParameters ( array $parameters ) : array Get the numeric parameters from a given list.
getPreviousUrlFromSession ( ) : string | null Get the previous URL from the session if possible.
getRootUrl ( string $scheme, string $root = null ) : string Get the base URL for the request.
getRouteDomain ( Illuminate\Routing\Route $route, array &$parameters ) : string Get the formatted domain for a given route.
getRouteQueryString ( array $parameters ) : string Get the query string for a given route.
getRouteRoot ( Illuminate\Routing\Route $route, string $domain ) : string Get the root of the route URL.
getRouteScheme ( Illuminate\Routing\Route $route ) : string Get the scheme for the given route.
getScheme ( boolean | null $secure ) : string Get the scheme for a raw URL.
getSession ( ) : Illuminate\Session\Store | null Get the session implementation from the resolver.
getStringParameters ( array $parameters ) : array Get the string parameters from a given list.
removeIndex ( string $root ) : string Remove the index.php file from a path.
replaceNamedParameters ( string $path, array &$parameters ) : string Replace all of the named parameters in the path.
replaceRoot ( Illuminate\Routing\Route $route, string $domain, array &$parameters ) : string Replace the parameters on the root path.
replaceRoutableParameters ( array $parameters = [] ) : array Replace UrlRoutable parameters with their route parameter.
replaceRouteParameters ( string $path, array &$parameters ) : string Replace all of the wildcard parameters for a route path.
toRoute ( Illuminate\Routing\Route $route, mixed $parameters, boolean $absolute ) : string Get the URL for a given route instance.

메소드 상세

__construct() 공개 메소드

Create a new URL Generator instance.
public __construct ( RouteCollection $routes, Illuminate\Http\Request $request ) : void
$routes RouteCollection
$request Illuminate\Http\Request
리턴 void

action() 공개 메소드

Get the URL to a controller action.
public action ( string $action, mixed $parameters = [], boolean $absolute = true ) : string
$action string
$parameters mixed
$absolute boolean
리턴 string

addPortToDomain() 보호된 메소드

Add the port to the domain if necessary.
protected addPortToDomain ( string $domain ) : string
$domain string
리턴 string

addQueryString() 보호된 메소드

Add a query string to the URI.
protected addQueryString ( string $uri, array $parameters ) : mixed | string
$uri string
$parameters array
리턴 mixed | string

asset() 공개 메소드

Generate the URL to an application asset.
public asset ( string $path, boolean | null $secure = null ) : string
$path string
$secure boolean | null
리턴 string

assetFrom() 공개 메소드

Generate the URL to an asset from a custom root domain such as CDN, etc.
public assetFrom ( string $root, string $path, boolean | null $secure = null ) : string
$root string
$path string
$secure boolean | null
리턴 string

buildCompleteUrl() 보호된 메소드

Format the given URL segments into a single URL.
protected buildCompleteUrl ( string $root, string $path, string $tail = '' ) : string
$root string
$path string
$tail string
리턴 string

current() 공개 메소드

Get the current URL for the request.
public current ( ) : string
리턴 string

forceRootUrl() 공개 메소드

Set the forced root URL.
public forceRootUrl ( string $root ) : void
$root string
리턴 void

forceSchema() 공개 메소드

Force the schema for URLs.
public forceSchema ( string $schema ) : void
$schema string
리턴 void

formatDomain() 보호된 메소드

Format the domain and port for the route and request.
protected formatDomain ( Illuminate\Routing\Route $route, array &$parameters ) : string
$route Illuminate\Routing\Route
$parameters array
리턴 string

formatHostUsing() 공개 메소드

Set a callback to be used to format the host of generated URLs.
public formatHostUsing ( Closur\Closure $callback )
$callback Closur\Closure

formatParameters() 보호된 메소드

Format the array of URL parameters.
protected formatParameters ( mixed | array $parameters ) : array
$parameters mixed | array
리턴 array

formatPathUsing() 공개 메소드

Set a callback to be used to format the path of generated URLs.
public formatPathUsing ( Closur\Closure $callback )
$callback Closur\Closure

full() 공개 메소드

Get the full URL for the current request.
public full ( ) : string
리턴 string

getDomainAndScheme() 보호된 메소드

Get the domain and scheme for the route.
protected getDomainAndScheme ( Illuminate\Routing\Route $route ) : string
$route Illuminate\Routing\Route
리턴 string

getNumericParameters() 보호된 메소드

Get the numeric parameters from a given list.
protected getNumericParameters ( array $parameters ) : array
$parameters array
리턴 array

getPreviousUrlFromSession() 보호된 메소드

Get the previous URL from the session if possible.
protected getPreviousUrlFromSession ( ) : string | null
리턴 string | null

getRequest() 공개 메소드

Get the request instance.
public getRequest ( ) : Illuminate\Http\Request
리턴 Illuminate\Http\Request

getRootUrl() 보호된 메소드

Get the base URL for the request.
protected getRootUrl ( string $scheme, string $root = null ) : string
$scheme string
$root string
리턴 string

getRouteDomain() 보호된 메소드

Get the formatted domain for a given route.
protected getRouteDomain ( Illuminate\Routing\Route $route, array &$parameters ) : string
$route Illuminate\Routing\Route
$parameters array
리턴 string

getRouteQueryString() 보호된 메소드

Get the query string for a given route.
protected getRouteQueryString ( array $parameters ) : string
$parameters array
리턴 string

getRouteRoot() 보호된 메소드

Get the root of the route URL.
protected getRouteRoot ( Illuminate\Routing\Route $route, string $domain ) : string
$route Illuminate\Routing\Route
$domain string
리턴 string

getRouteScheme() 보호된 메소드

Get the scheme for the given route.
protected getRouteScheme ( Illuminate\Routing\Route $route ) : string
$route Illuminate\Routing\Route
리턴 string

getScheme() 보호된 메소드

Get the scheme for a raw URL.
protected getScheme ( boolean | null $secure ) : string
$secure boolean | null
리턴 string

getSession() 보호된 메소드

Get the session implementation from the resolver.
protected getSession ( ) : Illuminate\Session\Store | null
리턴 Illuminate\Session\Store | null

getStringParameters() 보호된 메소드

Get the string parameters from a given list.
protected getStringParameters ( array $parameters ) : array
$parameters array
리턴 array

isValidUrl() 공개 메소드

Determine if the given path is a valid URL.
public isValidUrl ( string $path ) : boolean
$path string
리턴 boolean

pathFormatter() 공개 메소드

Get the path formatter being used by the URL generator.
public pathFormatter ( ) : Closure
리턴 Closure

previous() 공개 메소드

Get the URL for the previous request.
public previous ( mixed $fallback = false ) : string
$fallback mixed
리턴 string

removeIndex() 보호된 메소드

Remove the index.php file from a path.
protected removeIndex ( string $root ) : string
$root string
리턴 string

replaceNamedParameters() 보호된 메소드

Replace all of the named parameters in the path.
protected replaceNamedParameters ( string $path, array &$parameters ) : string
$path string
$parameters array
리턴 string

replaceRoot() 보호된 메소드

Replace the parameters on the root path.
protected replaceRoot ( Illuminate\Routing\Route $route, string $domain, array &$parameters ) : string
$route Illuminate\Routing\Route
$domain string
$parameters array
리턴 string

replaceRoutableParameters() 보호된 메소드

Replace UrlRoutable parameters with their route parameter.
protected replaceRoutableParameters ( array $parameters = [] ) : array
$parameters array
리턴 array

replaceRouteParameters() 보호된 메소드

Replace all of the wildcard parameters for a route path.
protected replaceRouteParameters ( string $path, array &$parameters ) : string
$path string
$parameters array
리턴 string

route() 공개 메소드

Get the URL to a named route.
public route ( string $name, mixed $parameters = [], boolean $absolute = true ) : string
$name string
$parameters mixed
$absolute boolean
리턴 string

secure() 공개 메소드

Generate a secure, absolute URL to the given path.
public secure ( string $path, array $parameters = [] ) : string
$path string
$parameters array
리턴 string

secureAsset() 공개 메소드

Generate the URL to a secure asset.
public secureAsset ( string $path ) : string
$path string
리턴 string

setRequest() 공개 메소드

Set the current request instance.
public setRequest ( Illuminate\Http\Request $request ) : void
$request Illuminate\Http\Request
리턴 void

setRootControllerNamespace() 공개 메소드

Set the root controller namespace.
public setRootControllerNamespace ( string $rootNamespace )
$rootNamespace string

setRoutes() 공개 메소드

Set the route collection.
public setRoutes ( RouteCollection $routes )
$routes RouteCollection

setSessionResolver() 공개 메소드

Set the session resolver for the generator.
public setSessionResolver ( callable $sessionResolver )
$sessionResolver callable

to() 공개 메소드

Generate an absolute URL to the given path.
public to ( string $path, mixed $extra = [], boolean | null $secure = null ) : string
$path string
$extra mixed
$secure boolean | null
리턴 string

toRoute() 보호된 메소드

Get the URL for a given route instance.
protected toRoute ( Illuminate\Routing\Route $route, mixed $parameters, boolean $absolute ) : string
$route Illuminate\Routing\Route
$parameters mixed
$absolute boolean
리턴 string

프로퍼티 상세

$cachedRoot 보호되어 있는 프로퍼티

A cached copy of the URL root for the current request.
protected string|null $cachedRoot
리턴 string | null

$cachedSchema 보호되어 있는 프로퍼티

A cached copy of the URL schema for the current request.
protected string|null $cachedSchema
리턴 string | null

$dontEncode 보호되어 있는 프로퍼티

Characters that should not be URL encoded.
protected array $dontEncode
리턴 array

$forceSchema 보호되어 있는 프로퍼티

The forced schema for URLs.
protected string $forceSchema
리턴 string

$forcedRoot 보호되어 있는 프로퍼티

The forced URL root.
protected string $forcedRoot
리턴 string

$formatHostUsing 보호되어 있는 프로퍼티

The callback to use to format hosts.
protected Closure $formatHostUsing
리턴 Closure

$formatPathUsing 보호되어 있는 프로퍼티

The callback to use to format paths.
protected Closure $formatPathUsing
리턴 Closure

$request 보호되어 있는 프로퍼티

The request instance.
protected Request,Illuminate\Http $request
리턴 Illuminate\Http\Request

$rootNamespace 보호되어 있는 프로퍼티

The root namespace being applied to controller actions.
protected string $rootNamespace
리턴 string

$routes 보호되어 있는 프로퍼티

The route collection.
protected RouteCollection,Illuminate\Routing $routes
리턴 Illuminate\Routing\RouteCollection

$sessionResolver 보호되어 있는 프로퍼티

The session resolver callable.
protected callable $sessionResolver
리턴 callable