0 follower

Final Class Yiisoft\Yii\DataView\Url\UrlConfig

InheritanceYiisoft\Yii\DataView\Url\UrlConfig

UrlConfig provides configuration for URL parameter handling in data views.

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\Yii\DataView\Url\UrlConfig
getArguments() Returns the additional URL arguments. Yiisoft\Yii\DataView\Url\UrlConfig
getPageParameterName() Returns the page parameter name. Yiisoft\Yii\DataView\Url\UrlConfig
getPageParameterType() Returns the page parameter type. Yiisoft\Yii\DataView\Url\UrlConfig
getPageSizeParameterName() Returns the page size parameter name. Yiisoft\Yii\DataView\Url\UrlConfig
getPageSizeParameterType() Returns the page size parameter type. Yiisoft\Yii\DataView\Url\UrlConfig
getPreviousPageParameterName() Returns the previous page parameter name. Yiisoft\Yii\DataView\Url\UrlConfig
getPreviousPageParameterType() Returns the previous page parameter type. Yiisoft\Yii\DataView\Url\UrlConfig
getQueryParameters() Returns the additional query parameters. Yiisoft\Yii\DataView\Url\UrlConfig
getSortParameterName() Returns the sort parameter name. Yiisoft\Yii\DataView\Url\UrlConfig
getSortParameterType() Returns the sort parameter type. Yiisoft\Yii\DataView\Url\UrlConfig
withArguments() Creates a new instance with the specified additional URL arguments. Yiisoft\Yii\DataView\Url\UrlConfig
withPageParameterName() Creates a new instance with the specified page parameter name. Yiisoft\Yii\DataView\Url\UrlConfig
withPageParameterType() Creates a new instance with the specified page parameter type. Yiisoft\Yii\DataView\Url\UrlConfig
withPageSizeParameterName() Creates a new instance with the specified page size parameter name. Yiisoft\Yii\DataView\Url\UrlConfig
withPageSizeParameterType() Creates a new instance with the specified page size parameter type. Yiisoft\Yii\DataView\Url\UrlConfig
withPreviousPageParameterName() Creates a new instance with the specified previous page parameter name. Yiisoft\Yii\DataView\Url\UrlConfig
withPreviousPageParameterType() Creates a new instance with the specified previous page parameter type. Yiisoft\Yii\DataView\Url\UrlConfig
withQueryParameters() Creates a new instance with the specified additional query parameters. Yiisoft\Yii\DataView\Url\UrlConfig
withSortParameterName() Creates a new instance with the specified sort parameter name. Yiisoft\Yii\DataView\Url\UrlConfig
withSortParameterType() Creates a new instance with the specified sort parameter type. Yiisoft\Yii\DataView\Url\UrlConfig

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( string $pageParameterName 'page', string $previousPageParameterName 'prev-page', string $pageSizeParameterName 'pagesize', string $sortParameterName 'sort', \Yiisoft\Yii\DataView\Url\UrlParameterType $pageParameterType UrlParameterType::Query, \Yiisoft\Yii\DataView\Url\UrlParameterType $previousPageParameterType UrlParameterType::Query, \Yiisoft\Yii\DataView\Url\UrlParameterType $pageSizeParameterType UrlParameterType::Query, \Yiisoft\Yii\DataView\Url\UrlParameterType $sortParameterType UrlParameterType::Query, array $arguments = [], array $queryParameters = [] )
$pageParameterName string

Name of the parameter for the current page number.

$previousPageParameterName string

Name of the parameter for the previous page.

$pageSizeParameterName string

Name of the parameter for items per page.

$sortParameterName string

Name of the parameter for sorting configuration.

$pageParameterType \Yiisoft\Yii\DataView\Url\UrlParameterType

Type of the page parameter (query or path).

$previousPageParameterType \Yiisoft\Yii\DataView\Url\UrlParameterType

Type of the previous page parameter.

$pageSizeParameterType \Yiisoft\Yii\DataView\Url\UrlParameterType

Type of the page size parameter.

$sortParameterType \Yiisoft\Yii\DataView\Url\UrlParameterType

Type of the sort parameter.

$arguments array

Additional URL arguments to be included in generated URLs.

$queryParameters array

Additional query parameters to be included in generated URLs.

                public function __construct(
    private string $pageParameterName = 'page',
    private string $previousPageParameterName = 'prev-page',
    private string $pageSizeParameterName = 'pagesize',
    private string $sortParameterName = 'sort',
    private UrlParameterType $pageParameterType = UrlParameterType::Query,
    private UrlParameterType $previousPageParameterType = UrlParameterType::Query,
    private UrlParameterType $pageSizeParameterType = UrlParameterType::Query,
    private UrlParameterType $sortParameterType = UrlParameterType::Query,
    private array $arguments = [],
    private array $queryParameters = [],
) {}

            
getArguments() public method

Returns the additional URL arguments.

public array getArguments ( )
return array

The additional URL arguments as key-value pairs.

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

            
getPageParameterName() public method

Returns the page parameter name.

public string getPageParameterName ( )
return string

The page parameter name.

                public function getPageParameterName(): string
{
    return $this->pageParameterName;
}

            
getPageParameterType() public method

Returns the page parameter type.

public \Yiisoft\Yii\DataView\Url\UrlParameterType getPageParameterType ( )
return \Yiisoft\Yii\DataView\Url\UrlParameterType

The page parameter type.

                public function getPageParameterType(): UrlParameterType
{
    return $this->pageParameterType;
}

            
getPageSizeParameterName() public method

Returns the page size parameter name.

public string getPageSizeParameterName ( )
return string

The page size parameter name.

                public function getPageSizeParameterName(): string
{
    return $this->pageSizeParameterName;
}

            
getPageSizeParameterType() public method

Returns the page size parameter type.

public \Yiisoft\Yii\DataView\Url\UrlParameterType getPageSizeParameterType ( )
return \Yiisoft\Yii\DataView\Url\UrlParameterType

The page size parameter type.

                public function getPageSizeParameterType(): UrlParameterType
{
    return $this->pageSizeParameterType;
}

            
getPreviousPageParameterName() public method

Returns the previous page parameter name.

public string getPreviousPageParameterName ( )
return string

The previous page parameter name.

                public function getPreviousPageParameterName(): string
{
    return $this->previousPageParameterName;
}

            
getPreviousPageParameterType() public method

Returns the previous page parameter type.

public \Yiisoft\Yii\DataView\Url\UrlParameterType getPreviousPageParameterType ( )
return \Yiisoft\Yii\DataView\Url\UrlParameterType

The previous page parameter type.

                public function getPreviousPageParameterType(): UrlParameterType
{
    return $this->previousPageParameterType;
}

            
getQueryParameters() public method

Returns the additional query parameters.

public array getQueryParameters ( )
return array

The additional query parameters as key-value pairs.

                public function getQueryParameters(): array
{
    return $this->queryParameters;
}

            
getSortParameterName() public method

Returns the sort parameter name.

public string getSortParameterName ( )
return string

The sort parameter name.

                public function getSortParameterName(): string
{
    return $this->sortParameterName;
}

            
getSortParameterType() public method

Returns the sort parameter type.

public \Yiisoft\Yii\DataView\Url\UrlParameterType getSortParameterType ( )
return \Yiisoft\Yii\DataView\Url\UrlParameterType

The sort parameter type.

                public function getSortParameterType(): UrlParameterType
{
    return $this->sortParameterType;
}

            
withArguments() public method

Creates a new instance with the specified additional URL arguments.

public self withArguments ( array $arguments )
$arguments array

The new additional URL arguments. These will completely replace any existing arguments.

return self

A new instance with the updated additional URL arguments.

                public function withArguments(array $arguments): self
{
    $new = clone $this;
    $new->arguments = $arguments;
    return $new;
}

            
withPageParameterName() public method

Creates a new instance with the specified page parameter name.

public self withPageParameterName ( string $name )
$name string

The new page parameter name.

return self

A new instance with the updated page parameter name.

                public function withPageParameterName(string $name): self
{
    $new = clone $this;
    $new->pageParameterName = $name;
    return $new;
}

            
withPageParameterType() public method

Creates a new instance with the specified page parameter type.

public self withPageParameterType ( \Yiisoft\Yii\DataView\Url\UrlParameterType $type )
$type \Yiisoft\Yii\DataView\Url\UrlParameterType

The new page parameter type.

return self

A new instance with the updated page parameter type.

                public function withPageParameterType(UrlParameterType $type): self
{
    $new = clone $this;
    $new->pageParameterType = $type;
    return $new;
}

            
withPageSizeParameterName() public method

Creates a new instance with the specified page size parameter name.

public self withPageSizeParameterName ( string $name )
$name string

The new page size parameter name.

return self

A new instance with the updated page size parameter name.

                public function withPageSizeParameterName(string $name): self
{
    $new = clone $this;
    $new->pageSizeParameterName = $name;
    return $new;
}

            
withPageSizeParameterType() public method

Creates a new instance with the specified page size parameter type.

public self withPageSizeParameterType ( \Yiisoft\Yii\DataView\Url\UrlParameterType $type )
$type \Yiisoft\Yii\DataView\Url\UrlParameterType

The new page size parameter type.

return self

A new instance with the updated page size parameter type.

                public function withPageSizeParameterType(UrlParameterType $type): self
{
    $new = clone $this;
    $new->pageSizeParameterType = $type;
    return $new;
}

            
withPreviousPageParameterName() public method

Creates a new instance with the specified previous page parameter name.

public self withPreviousPageParameterName ( string $name )
$name string

The new previous page parameter name.

return self

A new instance with the updated previous page parameter name.

                public function withPreviousPageParameterName(string $name): self
{
    $new = clone $this;
    $new->previousPageParameterName = $name;
    return $new;
}

            
withPreviousPageParameterType() public method

Creates a new instance with the specified previous page parameter type.

public self withPreviousPageParameterType ( \Yiisoft\Yii\DataView\Url\UrlParameterType $type )
$type \Yiisoft\Yii\DataView\Url\UrlParameterType

The new previous page parameter type.

return self

A new instance with the updated previous page parameter type.

                public function withPreviousPageParameterType(UrlParameterType $type): self
{
    $new = clone $this;
    $new->previousPageParameterType = $type;
    return $new;
}

            
withQueryParameters() public method

Creates a new instance with the specified additional query parameters.

public self withQueryParameters ( array $parameters )
$parameters array

The new additional query parameters. These will completely replace any existing query parameters.

return self

A new instance with the updated additional query parameters.

                public function withQueryParameters(array $parameters): self
{
    $new = clone $this;
    $new->queryParameters = $parameters;
    return $new;
}

            
withSortParameterName() public method

Creates a new instance with the specified sort parameter name.

public self withSortParameterName ( string $name )
$name string

The new sort parameter name.

return self

A new instance with the updated sort parameter name.

                public function withSortParameterName(string $name): self
{
    $new = clone $this;
    $new->sortParameterName = $name;
    return $new;
}

            
withSortParameterType() public method

Creates a new instance with the specified sort parameter type.

public self withSortParameterType ( \Yiisoft\Yii\DataView\Url\UrlParameterType $type )
$type \Yiisoft\Yii\DataView\Url\UrlParameterType

The new sort parameter type.

return self

A new instance with the updated sort parameter type.

                public function withSortParameterType(UrlParameterType $type): self
{
    $new = clone $this;
    $new->sortParameterType = $type;
    return $new;
}