Final Class Yiisoft\Yii\DataView\Url\UrlConfig
| Inheritance | Yiisoft\Yii\DataView\Url\UrlConfig |
|---|
UrlConfig provides configuration for URL parameter handling in data views.
Public Methods
Method Details
| 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 = [],
) {}
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;
}
Returns the page parameter name.
| public string getPageParameterName ( ) | ||
| return | string |
The page parameter name. |
|---|---|---|
public function getPageParameterName(): string
{
return $this->pageParameterName;
}
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;
}
Returns the page size parameter name.
| public string getPageSizeParameterName ( ) | ||
| return | string |
The page size parameter name. |
|---|---|---|
public function getPageSizeParameterName(): string
{
return $this->pageSizeParameterName;
}
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;
}
Returns the previous page parameter name.
| public string getPreviousPageParameterName ( ) | ||
| return | string |
The previous page parameter name. |
|---|---|---|
public function getPreviousPageParameterName(): string
{
return $this->previousPageParameterName;
}
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;
}
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;
}
Returns the sort parameter name.
| public string getSortParameterName ( ) | ||
| return | string |
The sort parameter name. |
|---|---|---|
public function getSortParameterName(): string
{
return $this->sortParameterName;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
Signup or Login in order to comment.