UrlFormat
in package
An attribute for denoting URL formatting for a route handler.
Attributes
- #[Attribute]
- \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE
Table of Contents
Methods
- __construct() : mixed
- getFragment() : string
- Returns the fragment component template for this URL format.
- getName() : string
- Returns the name for this URL format.
- getPath() : string
- Returns the path component template for this URL format.
- getQuery() : array<string, string>
- Returns the query component template for this URL format.
- register() : void
- Reads attributes from methods in a UrlSource instance and registers them to a given UrlRegistry instance.
Methods
__construct()
public
__construct(string $name, string $path[, array<string, string> $query = [] ][, string $fragment = '' ]) : mixed
Parameters
- $name : string
-
Name of the URL format.
- $path : string
-
Path component template of the URL.
- $query : array<string, string> = []
-
Query string component template for the URL.
- $fragment : string = ''
-
Fragment component template for the URL.
getFragment()
Returns the fragment component template for this URL format.
public
getFragment() : string
Return values
stringgetName()
Returns the name for this URL format.
public
getName() : string
Return values
stringgetPath()
Returns the path component template for this URL format.
public
getPath() : string
Return values
stringgetQuery()
Returns the query component template for this URL format.
public
getQuery() : array<string, string>
Return values
array<string, string>register()
Reads attributes from methods in a UrlSource instance and registers them to a given UrlRegistry instance.
public
static register(UrlRegistry $registry, UrlSource $source) : void
Parameters
- $registry : UrlRegistry
- $source : UrlSource