Final Class Yiisoft\Yii\DataView\ListView\ListView
| Inheritance | Yiisoft\Yii\DataView\ListView\ListView » Yiisoft\Yii\DataView\BaseListView » Yiisoft\Widget\Widget |
|---|
ListView is a flexible widget for displaying a list of data items with customizable rendering and layout.
Example usage:
`php
$listView = (new ListView())
->listTag('ul')
->listAttributes(['class' => 'my-list'])
->itemTag('li')
->itemView(fn($data, $context) => Html::encode($data['name']))
->dataReader($dataReader);
echo $listView->render();
`
Protected Properties
| Property | Type | Description | Defined By |
|---|---|---|---|
| $multiSort | boolean | Yiisoft\Yii\DataView\BaseListView | |
| $translationCategory | string | Yiisoft\Yii\DataView\BaseListView | |
| $translator | \Yiisoft\Translator\TranslatorInterface | A translator instance used for translations of messages. | Yiisoft\Yii\DataView\BaseListView |
| $urlConfig | Yiisoft\Yii\DataView\Url\UrlConfig | Yiisoft\Yii\DataView\BaseListView | |
| $urlCreator | Yiisoft\Yii\DataView\BaseListView | ||
| $urlParameterProvider | Yiisoft\Yii\DataView\Url\UrlParameterProviderInterface | Yiisoft\Yii\DataView\BaseListView |
Public Methods
Protected Methods
Constants
| Constant | Value | Description | Defined By |
|---|---|---|---|
| DEFAULT_TRANSLATION_CATEGORY | 'yii-dataview' | A name for {@see CategorySource} used with translator ({@see TranslatorInterface}) by default. | Yiisoft\Yii\DataView\BaseListView |
Method Details
| public mixed __construct ( ?\Yiisoft\Translator\TranslatorInterface $translator = null, string $translationCategory = self::DEFAULT_TRANSLATION_CATEGORY ) | ||
| $translator | ?\Yiisoft\Translator\TranslatorInterface | |
| $translationCategory | string | |
public function __construct(
?TranslatorInterface $translator = null,
string $translationCategory = self::DEFAULT_TRANSLATION_CATEGORY,
) {
$this->view = new View();
parent::__construct($translator, $translationCategory);
}
Defined in: Yiisoft\Yii\DataView\BaseListView::addContainerClass()
Adds one or more CSS classes to the existing container classes.
Multiple classes can be added by passing them as separate arguments. null values are filtered out
automatically.
| public static addContainerClass ( \BackedEnum|string|null $class ) | ||
| $class | \BackedEnum|string|null |
One or more CSS class names to add. Pass |
| return | Yiisoft\Yii\DataView\BaseListView |
A new instance with the specified CSS classes added to existing ones. |
|---|---|---|
public function addContainerClass(BackedEnum|string|null ...$class): static
{
$new = clone $this;
Html::addCssClass($new->containerAttributes, $class);
return $new;
}
| public static addHeaderClass ( \BackedEnum|string|null $class ) | ||
| $class | \BackedEnum|string|null | |
public function addHeaderClass(BackedEnum|string|null ...$class): static
{
$new = clone $this;
Html::addCssClass($new->headerAttributes, $class);
return $new;
}
Return new instance with a string or a function that is called after rendering each item.
See also \Yiisoft\Yii\DataView\ListView\renderAfterItem().
| public self afterItem ( Closure|string $value ) | ||
| $value | Closure|string |
A string or a callback with the following signature:
The return result of the function will be rendered directly. |
| return | self |
New instance. |
|---|---|---|
public function afterItem(Closure|string $value): self
{
$new = clone $this;
$new->afterItem = $value;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::append()
Returns a new instance with HTML content to be added before the closing container tag.
| public static append ( string|\Stringable $append ) | ||
| $append | string|\Stringable |
The HTML content to be appended. |
final public function append(string|Stringable ...$append): static
{
$new = clone $this;
$new->append = implode('', $append);
return $new;
}
Return new instance with a string or a function that is called before rendering each item.
See also \Yiisoft\Yii\DataView\ListView\renderBeforeItem().
| public self beforeItem ( Closure|string $value ) | ||
| $value | Closure|string |
A string or a callback with the following signature:
The return result of the function will be rendered directly. |
| return | self |
New instance. |
|---|---|---|
public function beforeItem(Closure|string $value): self
{
$new = clone $this;
$new->beforeItem = $value;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::containerAttributes()
Returns a new instance with the HTML attributes for container.
| public static containerAttributes ( array $attributes ) | ||
| $attributes | array |
Attribute values indexed by attribute names. |
final public function containerAttributes(array $attributes): static
{
$new = clone $this;
$new->containerAttributes = $attributes;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::containerClass()
Set new container classes.
Multiple classes can be set by passing them as separate arguments. null values are filtered out
automatically.
| public static containerClass ( \BackedEnum|string|null $class ) | ||
| $class | \BackedEnum|string|null |
One or more CSS class names to use. Pass |
| return | Yiisoft\Yii\DataView\BaseListView |
A new instance with the specified CSS classes set. |
|---|---|---|
public function containerClass(BackedEnum|string|null ...$class): static
{
$new = clone $this;
$new->containerAttributes['class'] = [];
Html::addCssClass($new->containerAttributes, $class);
return $new;
}
| public static containerTag ( ?string $tag ) | ||
| $tag | ?string | |
final public function containerTag(?string $tag): static
{
if ($tag === '') {
throw new InvalidArgumentException('Tag name cannot be empty.');
}
$new = clone $this;
$new->containerTag = $tag;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::dataReader()
| public static dataReader ( \Yiisoft\Data\Reader\ReadableDataInterface $dataReader ) | ||
| $dataReader | \Yiisoft\Data\Reader\ReadableDataInterface | |
final public function dataReader(ReadableDataInterface $dataReader): static
{
$new = clone $this;
$new->dataReader = $dataReader;
return $new;
}
| public static encodeHeader ( boolean $encode ) | ||
| $encode | boolean | |
final public function encodeHeader(bool $encode): static
{
$new = clone $this;
$new->encodeHeader = $encode;
return $new;
}
| protected \Yiisoft\Data\Reader\ReadableDataInterface getDataReader ( ) |
final protected function getDataReader(): ReadableDataInterface
{
if ($this->dataReader === null) {
throw new DataReaderNotSetException();
}
return $this->dataReader;
}
| protected integer getDefaultPageSize ( ) |
final protected function getDefaultPageSize(): int
{
$dataReader = $this->getDataReader();
$pageSize = $dataReader instanceof PaginatorInterface
? $dataReader->getPageSize()
: PaginatorInterface::DEFAULT_PAGE_SIZE;
if (is_int($this->pageSizeConstraint)) {
return $pageSize <= $this->pageSizeConstraint
? $pageSize
: $this->pageSizeConstraint;
}
if (is_array($this->pageSizeConstraint)) {
return in_array($pageSize, $this->pageSizeConstraint, true)
? $pageSize
: $this->pageSizeConstraint[0];
}
return $pageSize;
}
| protected string getNoResultsContent ( ) |
final protected function getNoResultsContent(): string
{
$text = $this->translator->translate(
$this->noResultsText,
category: $this->translationCategory,
);
return str_replace('{text}', $text, $this->noResultsTemplate);
}
Defined in: Yiisoft\Yii\DataView\BaseListView::header()
Return new instance with the header for the grid.
| public static header ( string $content ) | ||
| $content | string |
The header of the grid. {@see \Yiisoft\Yii\DataView\headerAttributes} |
final public function header(string $content): static
{
$new = clone $this;
$new->header = $content;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::headerAttributes()
Return new instance with the HTML attributes for the header.
| public static headerAttributes ( array $attributes ) | ||
| $attributes | array |
Attribute values indexed by attribute names. |
final public function headerAttributes(array $attributes): static
{
$new = clone $this;
$new->headerAttributes = $attributes;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::headerClass()
| public static headerClass ( \BackedEnum|string|null $class ) | ||
| $class | \BackedEnum|string|null | |
public function headerClass(BackedEnum|string|null ...$class): static
{
$new = clone $this;
$new->headerAttributes['class'] = [];
Html::addCssClass($new->headerAttributes, $class);
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::headerTag()
| public static headerTag ( ?string $tag ) | ||
| $tag | ?string | |
final public function headerTag(?string $tag): static
{
if ($tag === '') {
throw new InvalidArgumentException('Tag name cannot be empty.');
}
$new = clone $this;
$new->headerTag = $tag;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::id()
Returns a new instance with the id of the grid view, detail view, or list view.
| public static id ( string $id ) | ||
| $id | string |
The ID of the grid view, detail view, or list view. |
final public function id(string $id): static
{
$new = clone $this;
$new->containerAttributes['id'] = $id;
return $new;
}
| public static ignoreMissingPage ( boolean $enabled ) | ||
| $enabled | boolean | |
final public function ignoreMissingPage(bool $enabled): static
{
$new = clone $this;
$new->ignoreMissingPage = $enabled;
return $new;
}
Returns a new instance with the HTML attributes for list item.
| public self itemAttributes ( array|Closure $attributes ) | ||
| $attributes | array|Closure |
Attribute values/callbacks indexed by attribute names or a callback with the following signature:
Returned is an array of attributes. In the array of attributes, each attribute value can be a callback like the following:
|
public function itemAttributes(array|Closure $attributes): self
{
$new = clone $this;
$new->itemAttributes = $attributes;
return $new;
}
Set the HTML tag for the list item.
| public self itemTag ( string|null $tag ) | ||
| $tag | string|null |
The tag name. If |
| return | self |
New instance with the specified item tag. |
|---|---|---|
public function itemTag(?string $tag): self
{
if ($tag === '') {
throw new InvalidArgumentException('Tag name cannot be empty.');
}
$new = clone $this;
$new->itemTag = $tag;
return $new;
}
Return new instance with the content rendering configuration for each list item.
| public self itemView ( Closure|string $value ) | ||
| $value | Closure|string |
Either a view file path (string) or a closure for rendering item content. If a string is provided, it should be a path to a view file. The view will receive:
If a closure is provided, it should have the following signature:
|
| return | self |
New instance. |
|---|---|---|
public function itemView(string|Closure $value): self
{
$new = clone $this;
$new->itemView = $value;
return $new;
}
Return new instance with the additional parameters for the view.
| public self itemViewParameters ( array $parameters ) | ||
| $parameters | array |
Additional parameters to be passed to the view set in {@see \Yiisoft\Yii\DataView\ListView\itemView()} when it is being rendered. |
| return | self |
New instance with the specified view parameters. |
|---|---|---|
public function itemViewParameters(array $parameters): self
{
$new = clone $this;
$new->itemViewParameters = $parameters;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::keysetPaginationConfig()
Set configuration for keyset pagination widget.
| public static keysetPaginationConfig ( array $config ) | ||
| $config | array |
Widget config. |
final public function keysetPaginationConfig(array $config): static
{
$new = clone $this;
$new->keysetPaginationConfig = $config;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::layout()
Returns a new instance with the layout of the grid view, and list view.
| public static layout ( string $view ) | ||
| $view | string |
The template that determines how different sections of the grid view, list view. Should be organized. The following tokens will be replaced with the corresponding section contents:
|
final public function layout(string $view): static
{
$new = clone $this;
$new->layout = $view;
return $new;
}
Set the HTML attributes for the list.
| public self listAttributes ( array $attributes ) | ||
| $attributes | array |
Attribute values indexed by attribute names. |
| return | self |
New instance with the specified list attributes. |
|---|---|---|
public function listAttributes(array $attributes): self
{
$new = clone $this;
$new->listAttributes = $attributes;
return $new;
}
Set the HTML tag for the list.
| public self listTag ( string|null $tag ) | ||
| $tag | string|null |
The tag name. If |
| return | self |
New instance with the specified list tag. |
|---|---|---|
public function listTag(?string $tag): self
{
if ($tag === '') {
throw new InvalidArgumentException('Tag name cannot be empty.');
}
$new = clone $this;
$new->listTag = $tag;
return $new;
}
| protected array makeFilters ( ) |
protected function makeFilters(): array
{
return [[], new ValidationResult()];
}
Defined in: Yiisoft\Yii\DataView\BaseListView::multiSort()
| public static multiSort ( boolean $enable = true ) | ||
| $enable | boolean | |
final public function multiSort(bool $enable = true): static
{
$new = clone $this;
$new->multiSort = $enable;
return $new;
}
| public self noResultsAttributes ( array $attributes ) | ||
| $attributes | array | |
public function noResultsAttributes(array $attributes): self
{
$new = clone $this;
$new->noResultsAttributes = $attributes;
return $new;
}
| public self noResultsTag ( ?string $tag ) | ||
| $tag | ?string | |
public function noResultsTag(?string $tag): self
{
if ($tag === '') {
throw new InvalidArgumentException('Tag name cannot be empty.');
}
$new = clone $this;
$new->noResultsTag = $tag;
return $new;
}
| public static noResultsTemplate ( string $template ) | ||
| $template | string | |
final public function noResultsTemplate(string $template): static
{
$new = clone $this;
$new->noResultsTemplate = $template;
return $new;
}
| public static noResultsText ( string $text ) | ||
| $text | string | |
final public function noResultsText(string $text): static
{
$new = clone $this;
$new->noResultsText = $text;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::offsetPaginationConfig()
Set configuration for offset pagination widget.
| public static offsetPaginationConfig ( array $config ) | ||
| $config | array |
Widget config. |
final public function offsetPaginationConfig(array $config): static
{
$new = clone $this;
$new->offsetPaginationConfig = $config;
return $new;
}
| public static pageNotFoundExceptionCallback ( ?callable $callback ) | ||
| $callback | ?callable | |
final public function pageNotFoundExceptionCallback(?callable $callback): static
{
$new = clone $this;
$new->pageNotFoundExceptionCallback = $callback;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::pageParameterName()
Return a new instance with the name of argument or query parameter for page.
| public static pageParameterName ( string $name ) | ||
| $name | string |
The name of argument or query parameter for page. |
final public function pageParameterName(string $name): static
{
$new = clone $this;
$new->urlConfig = $this->urlConfig->withPageParameterName($name);
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::pageParameterType()
Creates a new instance with the specified page parameter type.
| public static pageParameterType ( \Yiisoft\Yii\DataView\Url\UrlParameterType $type ) | ||
| $type | \Yiisoft\Yii\DataView\Url\UrlParameterType |
The new page parameter type. |
| return | Yiisoft\Yii\DataView\BaseListView |
A new instance with the updated page parameter type. |
|---|---|---|
final public function pageParameterType(UrlParameterType $type): static
{
$new = clone $this;
$new->urlConfig = $this->urlConfig->withPageParameterType($type);
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::pageSizeAttributes()
Returns a new instance with the HTML attributes for page size wrapper tag.
| public static pageSizeAttributes ( array $attributes ) | ||
| $attributes | array |
Attribute values indexed by attribute names. |
final public function pageSizeAttributes(array $attributes): static
{
$new = clone $this;
$new->pageSizeAttributes = $attributes;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::pageSizeConstraint()
Get a new instance with a page size constraint set.
| public static pageSizeConstraint ( array|boolean|integer $pageSizeConstraint ) | ||
| $pageSizeConstraint | array|boolean|integer |
Page size constraint.
|
| return | Yiisoft\Yii\DataView\BaseListView |
New instance. |
|---|---|---|
final public function pageSizeConstraint(array|int|bool $pageSizeConstraint): static
{
$new = clone $this;
$new->pageSizeConstraint = $pageSizeConstraint;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::pageSizeParameterName()
Return a new instance with the name of argument or query parameter for page size.
| public static pageSizeParameterName ( string $name ) | ||
| $name | string |
The name of argument or query parameter for page size. |
final public function pageSizeParameterName(string $name): static
{
$new = clone $this;
$new->urlConfig = $this->urlConfig->withPageSizeParameterName($name);
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::pageSizeParameterType()
Creates a new instance with the specified page size parameter type.
| public static pageSizeParameterType ( \Yiisoft\Yii\DataView\Url\UrlParameterType $type ) | ||
| $type | \Yiisoft\Yii\DataView\Url\UrlParameterType |
The new page size parameter type. |
| return | Yiisoft\Yii\DataView\BaseListView |
A new instance with the updated page size parameter type. |
|---|---|---|
final public function pageSizeParameterType(UrlParameterType $type): static
{
$new = clone $this;
$new->urlConfig = $this->urlConfig->withPageSizeParameterType($type);
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::pageSizeTag()
| public static pageSizeTag ( ?string $tag ) | ||
| $tag | ?string | |
final public function pageSizeTag(?string $tag): static
{
if ($tag === '') {
throw new InvalidArgumentException('Tag name cannot be empty.');
}
$new = clone $this;
$new->pageSizeTag = $tag;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::pageSizeTemplate()
Returns a new instance with the page size template.
| public static pageSizeTemplate ( string|null $template ) | ||
| $template | string|null |
The HTML content to be displayed as the page size control. If you don't want to show
control, you may set it with an empty string or The following tokens will be replaced with the corresponding values:
|
final public function pageSizeTemplate(?string $template): static
{
$new = clone $this;
$new->pageSizeTemplate = $template;
return $new;
}
| public static pageSizeWidget ( ?\Yiisoft\Yii\DataView\PageSize\PageSizeWidgetInterface $widget ) | ||
| $widget | ?\Yiisoft\Yii\DataView\PageSize\PageSizeWidgetInterface | |
final public function pageSizeWidget(?PageSizeWidgetInterface $widget): static
{
$new = clone $this;
$new->pageSizeWidget = $widget;
return $new;
}
| public static paginationWidget ( ?\Yiisoft\Yii\DataView\Pagination\PaginationWidgetInterface $widget ) | ||
| $widget | ?\Yiisoft\Yii\DataView\Pagination\PaginationWidgetInterface | |
final public function paginationWidget(?PaginationWidgetInterface $widget): static
{
$new = clone $this;
$new->paginationWidget = $widget;
return $new;
}
| protected array prepareOrder ( array $order ) | ||
| $order | array | |
protected function prepareOrder(array $order): array
{
return [];
}
Defined in: Yiisoft\Yii\DataView\BaseListView::prepend()
Returns a new instance with HTML content to be added after the opening container tag.
| public static prepend ( string|\Stringable $prepend ) | ||
| $prepend | string|\Stringable |
The HTML content to be prepended. |
final public function prepend(string|Stringable ...$prepend): static
{
$new = clone $this;
$new->prepend = implode('', $prepend);
return $new;
}
| public static previousPageParameterName ( string $name ) | ||
| $name | string | |
final public function previousPageParameterName(string $name): static
{
$new = clone $this;
$new->urlConfig = $this->urlConfig->withPreviousPageParameterName($name);
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::previousPageParameterType()
Creates a new instance with the specified previous page parameter type.
| public static previousPageParameterType ( \Yiisoft\Yii\DataView\Url\UrlParameterType $type ) | ||
| $type | \Yiisoft\Yii\DataView\Url\UrlParameterType |
The new previous page parameter type. |
| return | Yiisoft\Yii\DataView\BaseListView |
A new instance with the updated previous page parameter type. |
|---|---|---|
final public function previousPageParameterType(UrlParameterType $type): static
{
$new = clone $this;
$new->urlConfig = $this->urlConfig->withPreviousPageParameterType($type);
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::render()
| public string render ( ) |
final public function render(): string
{
[$filters, $filterValidationResult] = $this->makeFilters();
[$preparedDataReader, $items] = $filters === null
? [null, []]
: $this->prepareDataReaderAndItems($filters);
$content = trim(
strtr(
$this->layout,
[
'{header}' => $this->renderHeader(),
'{toolbar}' => $this->toolbar,
'{items}' => $this->renderItems($items, $filterValidationResult, $preparedDataReader),
'{summary}' => $this->renderSummary($preparedDataReader),
'{pager}' => $this->renderPagination($preparedDataReader),
'{pageSize}' => $this->renderPageSize($preparedDataReader),
],
),
);
if ($this->prepend !== '') {
$content = $this->prepend . "\n" . $content;
}
if ($this->append !== '') {
$content .= "\n" . $this->append;
}
return $this->containerTag === null
? $content
: Html::tag($this->containerTag, "\n" . $content . "\n", $this->containerAttributes)
->encode(false)
->render();
}
| protected string renderItems ( array $items, \Yiisoft\Validator\Result $filterValidationResult, ?\Yiisoft\Data\Reader\ReadableDataInterface $preparedDataReader ) | ||
| $items | array | |
| $filterValidationResult | \Yiisoft\Validator\Result | |
| $preparedDataReader | ?\Yiisoft\Data\Reader\ReadableDataInterface | |
protected function renderItems(
array $items,
ValidationResult $filterValidationResult,
?ReadableDataInterface $preparedDataReader,
): string {
if (empty($items)) {
return $this->renderNoResults();
}
$rows = [];
foreach ($items as $key => $value) {
$context = new ListItemContext($value, $key, count($rows), $this);
$rows[] = $this->renderBeforeItem($context)
. $this->renderItem($context)
. $this->renderAfterItem($context);
}
$content = implode($this->separator, $rows);
return $this->listTag === null
? $content
: Html::tag($this->listTag, "\n" . $content . "\n", $this->listAttributes)
->encode(false)
->render();
}
Return new instance with the separator between the items.
| public self separator ( string $separator ) | ||
| $separator | string |
The HTML code to be displayed between any two consecutive items. |
| return | self |
New instance with the specified separator. |
|---|---|---|
public function separator(string $separator): self
{
$new = clone $this;
$new->separator = $separator;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::sortParameterName()
Creates a new instance with the specified sort parameter name.
| public static sortParameterName ( string $name ) | ||
| $name | string |
The new sort parameter name. |
| return | Yiisoft\Yii\DataView\BaseListView |
A new instance with the updated sort parameter name. |
|---|---|---|
final public function sortParameterName(string $name): static
{
$new = clone $this;
$new->urlConfig = $this->urlConfig->withSortParameterName($name);
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::sortParameterType()
Creates a new instance with the specified sort parameter type.
| public static sortParameterType ( \Yiisoft\Yii\DataView\Url\UrlParameterType $type ) | ||
| $type | \Yiisoft\Yii\DataView\Url\UrlParameterType |
The new sort parameter type. |
| return | Yiisoft\Yii\DataView\BaseListView |
A new instance with the updated sort parameter type. |
|---|---|---|
final public function sortParameterType(UrlParameterType $type): static
{
$new = clone $this;
$new->urlConfig = $this->urlConfig->withSortParameterType($type);
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::summaryAttributes()
Returns a new instance with the HTML attributes for summary wrapper tag.
| public static summaryAttributes ( array $attributes ) | ||
| $attributes | array |
Attribute values indexed by attribute names. |
final public function summaryAttributes(array $attributes): static
{
$new = clone $this;
$new->summaryAttributes = $attributes;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::summaryTag()
| public static summaryTag ( ?string $tag ) | ||
| $tag | ?string | |
final public function summaryTag(?string $tag): static
{
if ($tag === '') {
throw new InvalidArgumentException('Tag name cannot be empty.');
}
$new = clone $this;
$new->summaryTag = $tag;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::summaryTemplate()
Returns a new instance with the summary template.
| public static summaryTemplate ( string|null $template ) | ||
| $template | string|null |
The HTML content to be displayed as the summary. If you don't want to show the summary, you may set it with an empty string or null. The following tokens will be replaced with the corresponding values:
|
final public function summaryTemplate(?string $template): static
{
$new = clone $this;
$new->summaryTemplate = $template;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::toolbar()
Return new instance with toolbar content.
| public static toolbar ( string $content ) | ||
| $content | string |
The toolbar content. |
final public function toolbar(string $content): static
{
$new = clone $this;
$new->toolbar = $content;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::urlArguments()
Return a new instance with arguments of the route.
| public static urlArguments ( array $arguments ) | ||
| $arguments | array |
Arguments of the route. |
final public function urlArguments(array $arguments): static
{
$new = clone $this;
$new->urlConfig = $this->urlConfig->withArguments($arguments);
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::urlCreator()
| public static urlCreator ( ?callable $urlCreator ) | ||
| $urlCreator | ?callable | |
final public function urlCreator(?callable $urlCreator): static
{
$new = clone $this;
$new->urlCreator = $urlCreator;
return $new;
}
| public static urlParameterProvider ( Yiisoft\Yii\DataView\Url\UrlParameterProviderInterface $provider ) | ||
| $provider | Yiisoft\Yii\DataView\Url\UrlParameterProviderInterface | |
final public function urlParameterProvider(UrlParameterProviderInterface $provider): static
{
$new = clone $this;
$new->urlParameterProvider = $provider;
return $new;
}
Defined in: Yiisoft\Yii\DataView\BaseListView::urlQueryParameters()
Return a new instance with query parameters of the route.
| public static urlQueryParameters ( array $parameters ) | ||
| $parameters | array |
The query parameters of the route. |
final public function urlQueryParameters(array $parameters): static
{
$new = clone $this;
$new->urlConfig = $this->urlConfig->withQueryParameters($parameters);
return $new;
}
Signup or Login in order to comment.