0 follower

Final Class Yiisoft\Router\CurrentRoute

InheritanceYiisoft\Router\CurrentRoute

Holds information about current route e.g. matched last.

Public Methods

Hide inherited 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

Hide inherited methods

getArgument() public method

public getArgument( string $name, string|null $default null ): string|null
$name string
$default string|null

                public function getArgument(string $name, ?string $default = null): ?string
{
    return $this->arguments[$name] ?? $default;
}

            
getArguments() public method

public getArguments( ): array<string, string>
return array<string, string>

Arguments.

                public function getArguments(): array
{
    return $this->arguments;
}

            
getHost() public method

Returns the current route host.

public getHost( ): string|null
return string|null

The current route host.

                public function getHost(): ?string
{
    return $this->route?->getData('host');
}

            
getMethods() public method

Returns the current route methods.

public getMethods( ): string[]|null
return string[]|null

The current route methods.

                public function getMethods(): ?array
{
    return $this->route?->getData('methods');
}

            
getName() public method

Returns the current route name.

public getName( ): string|null
return string|null

The current route name.

                public function getName(): ?string
{
    return $this->route?->getData('name');
}

            
getPattern() public method

Returns the current route pattern.

public getPattern( ): string|null
return string|null

The current route pattern.

                public function getPattern(): ?string
{
    return $this->route?->getData('pattern');
}

            
getUri() public method

Returns the current URI.

public getUri( ): \Psr\Http\Message\UriInterface|null
return \Psr\Http\Message\UriInterface|null

The current URI.

                public function getUri(): ?UriInterface
{
    return $this->uri;
}