RouteBlueprint
class RouteBlueprint (View source)
Provide a fluent interface for registering routes with the router.
Traits
Methods
Fluent alias for setAttribute().
Fluent alias for setAttributes().
Match requests using one of the specified methods.
Set the condition attribute to a URL.
Set the condition attribute.
Set the middleware attribute.
Set the namespace attribute.
Set the query attribute.
Set the name attribute.
Handle a request by directly rendering a view.
Match requests with a method of GET or HEAD.
Match requests with a method of POST.
Match requests with a method of PUT.
Match requests with a method of PATCH.
Match requests with a method of DELETE.
Match requests with a method of OPTIONS.
Match requests with any method.
Details
in HasAttributesTrait at line 32
mixed
getAttribute(string $attribute, mixed $default = '')
Get attribute.
in HasAttributesTrait at line 41
array
getAttributes()
Get all attributes.
in HasAttributesTrait at line 52
void
setAttribute(string $attribute, mixed $value)
Set attribute.
in HasAttributesTrait at line 67
HasAttributesTrait
attribute(string $attribute, mixed $value)
Fluent alias for setAttribute().
in HasAttributesTrait at line 80
void
setAttributes(array $attributes)
Set all attributes.
No attempt to merge attributes is done - this is a direct overwrite operation.
in HasAttributesTrait at line 91
HasAttributesTrait
attributes(array $attributes)
Fluent alias for setAttributes().
at line 44
__construct(Router $router, ViewService $view_service)
Constructor.
at line 55
RouteBlueprint
methods(string[] $methods)
Match requests using one of the specified methods.
at line 71
RouteBlueprint
url(string $url, array $where = [])
Set the condition attribute to a URL.
at line 82
RouteBlueprint
where($condition)
Set the condition attribute.
at line 101
RouteBlueprint
middleware(string|string[] $middleware)
Set the middleware attribute.
at line 118
RouteBlueprint
setNamespace(string $namespace)
Set the namespace attribute.
This should be renamed to namespace for consistency once minimum PHP version is increased to 7+.
at line 133
RouteBlueprint
query(callable $query)
Set the query attribute.
at line 148
RouteBlueprint
name(string $name)
Set the name attribute.
at line 190
void
view(string|string[] $views)
Handle a request by directly rendering a view.
at line 211
RouteBlueprint
get()
Match requests with a method of GET or HEAD.
at line 220
RouteBlueprint
post()
Match requests with a method of POST.
at line 229
RouteBlueprint
put()
Match requests with a method of PUT.
at line 238
RouteBlueprint
patch()
Match requests with a method of PATCH.
at line 247
RouteBlueprint
delete()
Match requests with a method of DELETE.
at line 256
RouteBlueprint
options()
Match requests with a method of OPTIONS.
at line 265
RouteBlueprint
any()
Match requests with any method.