Final Class Yiisoft\Router\CurrentRoute
| Inheritance | Yiisoft\Router\CurrentRoute |
|---|
Holds information about current route e.g. matched last.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| getArgument() | Yiisoft\Router\CurrentRoute | |
| getArguments() | Yiisoft\Router\CurrentRoute | |
| getHost() | Returns the current route host. | Yiisoft\Router\CurrentRoute |
| getMethods() | Returns the current route methods. | Yiisoft\Router\CurrentRoute |
| getName() | Returns the current route name. | Yiisoft\Router\CurrentRoute |
| getPattern() | Returns the current route pattern. | Yiisoft\Router\CurrentRoute |
| getUri() | Returns the current URI. | Yiisoft\Router\CurrentRoute |
Method Details
| public string|null getArgument ( string $name, string|null $default = null ) | ||
| $name | string | |
| $default | string|null | |
public function getArgument(string $name, ?string $default = null): ?string
{
return $this->arguments[$name] ?? $default;
}
| public array<string, string> getArguments ( ) | ||
| return | array<string, string> |
Arguments. |
|---|---|---|
public function getArguments(): array
{
return $this->arguments;
}
Returns the current route host.
| public string|null getHost ( ) | ||
| return | string|null |
The current route host. |
|---|---|---|
public function getHost(): ?string
{
return $this->route?->getData('host');
}
Returns the current route methods.
| public string[]|null getMethods ( ) | ||
| return | string[]|null |
The current route methods. |
|---|---|---|
public function getMethods(): ?array
{
return $this->route?->getData('methods');
}
Returns the current route name.
| public string|null getName ( ) | ||
| return | string|null |
The current route name. |
|---|---|---|
public function getName(): ?string
{
return $this->route?->getData('name');
}
Returns the current route pattern.
| public string|null getPattern ( ) | ||
| return | string|null |
The current route pattern. |
|---|---|---|
public function getPattern(): ?string
{
return $this->route?->getData('pattern');
}
Signup or Login in order to comment.