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 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;
}

            
getArguments() public method

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

Arguments.

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

            
getHost() public method

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');
}

            
getMethods() public method

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');
}

            
getName() public method

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');
}

            
getPattern() public method

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');
}

            
getUri() public method

Returns the current URI.

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

The current URI.

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