0 follower

Abstract Class Yiisoft\Yii\DataView\BaseListView

InheritanceYiisoft\Yii\DataView\BaseListView » Yiisoft\Widget\Widget
SubclassesYiisoft\Yii\DataView\GridView\GridView, Yiisoft\Yii\DataView\ListView\ListView

BaseListView is an abstract base class for {@see GridView} and {@see ListView} only.

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\Yii\DataView\BaseListView
addContainerClass() Adds one or more CSS classes to the existing container classes. Yiisoft\Yii\DataView\BaseListView
addHeaderClass() Yiisoft\Yii\DataView\BaseListView
append() Returns a new instance with HTML content to be added before the closing container tag. Yiisoft\Yii\DataView\BaseListView
containerAttributes() Returns a new instance with the HTML attributes for container. Yiisoft\Yii\DataView\BaseListView
containerClass() Set new container classes. Yiisoft\Yii\DataView\BaseListView
containerTag() Yiisoft\Yii\DataView\BaseListView
dataReader() Yiisoft\Yii\DataView\BaseListView
encodeHeader() Yiisoft\Yii\DataView\BaseListView
header() Return new instance with the header for the grid. Yiisoft\Yii\DataView\BaseListView
headerAttributes() Return new instance with the HTML attributes for the header. Yiisoft\Yii\DataView\BaseListView
headerClass() Yiisoft\Yii\DataView\BaseListView
headerTag() Yiisoft\Yii\DataView\BaseListView
id() Returns a new instance with the id of the grid view, detail view, or list view. Yiisoft\Yii\DataView\BaseListView
ignoreMissingPage() Yiisoft\Yii\DataView\BaseListView
keysetPaginationConfig() Set configuration for keyset pagination widget. Yiisoft\Yii\DataView\BaseListView
layout() Returns a new instance with the layout of the grid view, and list view. Yiisoft\Yii\DataView\BaseListView
multiSort() Yiisoft\Yii\DataView\BaseListView
noResultsTemplate() Yiisoft\Yii\DataView\BaseListView
noResultsText() Yiisoft\Yii\DataView\BaseListView
offsetPaginationConfig() Set configuration for offset pagination widget. Yiisoft\Yii\DataView\BaseListView
pageNotFoundExceptionCallback() Yiisoft\Yii\DataView\BaseListView
pageParameterName() Return a new instance with the name of argument or query parameter for page. Yiisoft\Yii\DataView\BaseListView
pageParameterType() Creates a new instance with the specified page parameter type. Yiisoft\Yii\DataView\BaseListView
pageSizeAttributes() Returns a new instance with the HTML attributes for page size wrapper tag. Yiisoft\Yii\DataView\BaseListView
pageSizeConstraint() Get a new instance with a page size constraint set. Yiisoft\Yii\DataView\BaseListView
pageSizeParameterName() Return a new instance with the name of argument or query parameter for page size. Yiisoft\Yii\DataView\BaseListView
pageSizeParameterType() Creates a new instance with the specified page size parameter type. Yiisoft\Yii\DataView\BaseListView
pageSizeTag() Yiisoft\Yii\DataView\BaseListView
pageSizeTemplate() Returns a new instance with the page size template. Yiisoft\Yii\DataView\BaseListView
pageSizeWidget() Yiisoft\Yii\DataView\BaseListView
paginationWidget() Yiisoft\Yii\DataView\BaseListView
prepend() Returns a new instance with HTML content to be added after the opening container tag. Yiisoft\Yii\DataView\BaseListView
previousPageParameterName() Yiisoft\Yii\DataView\BaseListView
previousPageParameterType() Creates a new instance with the specified previous page parameter type. Yiisoft\Yii\DataView\BaseListView
render() Yiisoft\Yii\DataView\BaseListView
sortParameterName() Creates a new instance with the specified sort parameter name. Yiisoft\Yii\DataView\BaseListView
sortParameterType() Creates a new instance with the specified sort parameter type. Yiisoft\Yii\DataView\BaseListView
summaryAttributes() Returns a new instance with the HTML attributes for summary wrapper tag. Yiisoft\Yii\DataView\BaseListView
summaryTag() Yiisoft\Yii\DataView\BaseListView
summaryTemplate() Returns a new instance with the summary template. Yiisoft\Yii\DataView\BaseListView
toolbar() Return new instance with toolbar content. Yiisoft\Yii\DataView\BaseListView
urlArguments() Return a new instance with arguments of the route. Yiisoft\Yii\DataView\BaseListView
urlCreator() Yiisoft\Yii\DataView\BaseListView
urlParameterProvider() Yiisoft\Yii\DataView\BaseListView
urlQueryParameters() Return a new instance with query parameters of the route. Yiisoft\Yii\DataView\BaseListView

Constants

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

Property Details

Hide inherited properties

$multiSort protected property
protected boolean $multiSort false
$translationCategory protected property
protected string $translationCategory self::DEFAULT_TRANSLATION_CATEGORY
$translator protected property

A translator instance used for translations of messages. If it wasn't set explicitly in the constructor, a default one created automatically in {@see \Yiisoft\Yii\DataView\createDefaultTranslator()}.

protected \Yiisoft\Translator\TranslatorInterface $translator null
$urlConfig protected property
$urlCreator protected property
protected $urlCreator null
$urlParameterProvider protected property

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( \Yiisoft\Translator\TranslatorInterface|null $translator null, string $translationCategory self::DEFAULT_TRANSLATION_CATEGORY )
$translator \Yiisoft\Translator\TranslatorInterface|null
$translationCategory string

                public function __construct(
    ?TranslatorInterface $translator = null,
    protected readonly string $translationCategory = self::DEFAULT_TRANSLATION_CATEGORY,
) {
    $this->translator = $translator ?? $this->createDefaultTranslator();
    $this->urlConfig = new UrlConfig();
    $this->urlParameterProvider = new NullUrlParameterProvider();
}

            
addContainerClass() public method

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 Yiisoft\Yii\DataView\BaseListView addContainerClass ( \BackedEnum|string|null $class )
$class \BackedEnum|string|null

One or more CSS class names to add. Pass null to skip adding a class.

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

            
addHeaderClass() public method

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
append() public method

Returns a new instance with HTML content to be added before the closing container tag.

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
containerAttributes() public method

Returns a new instance with the HTML attributes for container.

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
containerClass() public method

Set new container classes.

Multiple classes can be set by passing them as separate arguments. null values are filtered out automatically.

public Yiisoft\Yii\DataView\BaseListView containerClass ( \BackedEnum|string|null $class )
$class \BackedEnum|string|null

One or more CSS class names to use. Pass null to skip a class.

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

            
containerTag() public method

public Yiisoft\Yii\DataView\BaseListView containerTag ( string|null $tag )
$tag string|null

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

            
dataReader() public method

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
encodeHeader() public method

public Yiisoft\Yii\DataView\BaseListView encodeHeader ( boolean $encode )
$encode boolean

                final public function encodeHeader(bool $encode): static
{
    $new = clone $this;
    $new->encodeHeader = $encode;
    return $new;
}

            
getDataReader() protected method

protected \Yiisoft\Data\Reader\ReadableDataInterface getDataReader ( )

                final protected function getDataReader(): ReadableDataInterface
{
    if ($this->dataReader === null) {
        throw new DataReaderNotSetException();
    }
    return $this->dataReader;
}

            
getDefaultPageSize() protected method

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

            
getNoResultsContent() protected method

protected string getNoResultsContent ( )

                final protected function getNoResultsContent(): string
{
    $text = $this->translator->translate(
        $this->noResultsText,
        category: $this->translationCategory,
    );
    return str_replace('{text}', $text, $this->noResultsTemplate);
}

            
header() public method

Return new instance with the header for the grid.

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
headerAttributes() public method

Return new instance with the HTML attributes for the header.

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
headerClass() public method

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
headerTag() public method

public Yiisoft\Yii\DataView\BaseListView headerTag ( string|null $tag )
$tag string|null

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

            
id() public method

Returns a new instance with the id of the grid view, detail view, or list view.

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
ignoreMissingPage() public method

public Yiisoft\Yii\DataView\BaseListView ignoreMissingPage ( boolean $enabled )
$enabled boolean

                final public function ignoreMissingPage(bool $enabled): static
{
    $new = clone $this;
    $new->ignoreMissingPage = $enabled;
    return $new;
}

            
keysetPaginationConfig() public method

Set configuration for keyset pagination widget.

public Yiisoft\Yii\DataView\BaseListView keysetPaginationConfig ( array $config )
$config array

Widget config.

                final public function keysetPaginationConfig(array $config): static
{
    $new = clone $this;
    $new->keysetPaginationConfig = $config;
    return $new;
}

            
layout() public method

Returns a new instance with the layout of the grid view, and list view.

public Yiisoft\Yii\DataView\BaseListView 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:

  • {header}: The header section.
  • {toolbar}: The toolbar section.

                final public function layout(string $view): static
{
    $new = clone $this;
    $new->layout = $view;
    return $new;
}

            
makeFilters() protected abstract method

protected abstract array makeFilters ( )
return array

The array with format: [ FilterInterface[]|null, // Array of filters or `null` if there are definitely no entries for the current filter ValidationResult, // Validation result of the filter ]

                abstract protected function makeFilters(): array;

            
multiSort() public method

public Yiisoft\Yii\DataView\BaseListView multiSort ( boolean $enable true )
$enable boolean

                final public function multiSort(bool $enable = true): static
{
    $new = clone $this;
    $new->multiSort = $enable;
    return $new;
}

            
noResultsTemplate() public method

public Yiisoft\Yii\DataView\BaseListView noResultsTemplate ( string $template )
$template string

                final public function noResultsTemplate(string $template): static
{
    $new = clone $this;
    $new->noResultsTemplate = $template;
    return $new;
}

            
noResultsText() public method

public Yiisoft\Yii\DataView\BaseListView noResultsText ( string $text )
$text string

                final public function noResultsText(string $text): static
{
    $new = clone $this;
    $new->noResultsText = $text;
    return $new;
}

            
offsetPaginationConfig() public method

Set configuration for offset pagination widget.

public Yiisoft\Yii\DataView\BaseListView offsetPaginationConfig ( array $config )
$config array

Widget config.

                final public function offsetPaginationConfig(array $config): static
{
    $new = clone $this;
    $new->offsetPaginationConfig = $config;
    return $new;
}

            
pageNotFoundExceptionCallback() public method

public Yiisoft\Yii\DataView\BaseListView pageNotFoundExceptionCallback ( callable|null $callback )
$callback callable|null

                final public function pageNotFoundExceptionCallback(?callable $callback): static
{
    $new = clone $this;
    $new->pageNotFoundExceptionCallback = $callback;
    return $new;
}

            
pageParameterName() public method

Return a new instance with the name of argument or query parameter for page.

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
pageParameterType() public method

Creates a new instance with the specified page parameter type.

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
pageSizeAttributes() public method

Returns a new instance with the HTML attributes for page size wrapper tag.

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
pageSizeConstraint() public method

Get a new instance with a page size constraint set.

public Yiisoft\Yii\DataView\BaseListView pageSizeConstraint ( array|boolean|integer $pageSizeConstraint )
$pageSizeConstraint array|boolean|integer

Page size constraint. true - default only. false - no constraint. int - maximum page size. [int, int, ...] - a list of page sizes to choose from.

return Yiisoft\Yii\DataView\BaseListView

New instance.

                final public function pageSizeConstraint(array|int|bool $pageSizeConstraint): static
{
    $new = clone $this;
    $new->pageSizeConstraint = $pageSizeConstraint;
    return $new;
}

            
pageSizeParameterName() public method

Return a new instance with the name of argument or query parameter for page size.

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
pageSizeParameterType() public method

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

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
pageSizeTag() public method

public Yiisoft\Yii\DataView\BaseListView pageSizeTag ( string|null $tag )
$tag string|null

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

            
pageSizeTemplate() public method

Returns a new instance with the page size template.

public Yiisoft\Yii\DataView\BaseListView 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 null.

The following tokens will be replaced with the corresponding values:

  • {widget} — page size widget.

                final public function pageSizeTemplate(?string $template): static
{
    $new = clone $this;
    $new->pageSizeTemplate = $template;
    return $new;
}

            
pageSizeWidget() public method

public Yiisoft\Yii\DataView\BaseListView pageSizeWidget ( Yiisoft\Yii\DataView\PageSize\PageSizeWidgetInterface|null $widget )
$widget Yiisoft\Yii\DataView\PageSize\PageSizeWidgetInterface|null

                final public function pageSizeWidget(?PageSizeWidgetInterface $widget): static
{
    $new = clone $this;
    $new->pageSizeWidget = $widget;
    return $new;
}

            
paginationWidget() public method

public Yiisoft\Yii\DataView\BaseListView paginationWidget ( Yiisoft\Yii\DataView\Pagination\PaginationWidgetInterface|null $widget )
$widget Yiisoft\Yii\DataView\Pagination\PaginationWidgetInterface|null

                final public function paginationWidget(?PaginationWidgetInterface $widget): static
{
    $new = clone $this;
    $new->paginationWidget = $widget;
    return $new;
}

            
prepareOrder() protected abstract method

protected abstract array prepareOrder ( array $order )
$order array

                abstract protected function prepareOrder(array $order): array;

            
prepend() public method

Returns a new instance with HTML content to be added after the opening container tag.

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
previousPageParameterName() public method

public Yiisoft\Yii\DataView\BaseListView previousPageParameterName ( string $name )
$name string

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

            
previousPageParameterType() public method

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

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
render() public method

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

            
renderItems() protected abstract method

Renders the data models.

protected abstract string renderItems ( (array|object)[] $items, \Yiisoft\Validator\Result $filterValidationResult, \Yiisoft\Data\Reader\ReadableDataInterface|null $preparedDataReader )
$items (array|object)[]

The data models to be rendered.

$filterValidationResult \Yiisoft\Validator\Result

The validation result of the filter.

$preparedDataReader \Yiisoft\Data\Reader\ReadableDataInterface|null

The prepared data reader, null means that there is no data.

return string

The rendering result.

                abstract protected function renderItems(
    array $items,
    ValidationResult $filterValidationResult,
    ?ReadableDataInterface $preparedDataReader,
): string;

            
sortParameterName() public method

Creates a new instance with the specified sort parameter name.

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
sortParameterType() public method

Creates a new instance with the specified sort parameter type.

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
summaryAttributes() public method

Returns a new instance with the HTML attributes for summary wrapper tag.

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
summaryTag() public method

public Yiisoft\Yii\DataView\BaseListView summaryTag ( string|null $tag )
$tag string|null

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

            
summaryTemplate() public method

Returns a new instance with the summary template.

public Yiisoft\Yii\DataView\BaseListView 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:

  • {begin} — the starting row number (1-based) currently being displayed.
  • {end} — the ending row number (1-based) currently being displayed.
  • {count} — the number of rows currently being displayed.
  • {totalCount} — the total number of rows available.
  • {currentPage} — the page number (1-based) current being displayed.
  • {totalPages} — the number of pages available.

                final public function summaryTemplate(?string $template): static
{
    $new = clone $this;
    $new->summaryTemplate = $template;
    return $new;
}

            
toolbar() public method

Return new instance with toolbar content.

public Yiisoft\Yii\DataView\BaseListView toolbar ( string $content )
$content string

The toolbar content.

                final public function toolbar(string $content): static
{
    $new = clone $this;
    $new->toolbar = $content;
    return $new;
}

            
urlArguments() public method

Return a new instance with arguments of the route.

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
urlCreator() public method

public Yiisoft\Yii\DataView\BaseListView urlCreator ( callable|null $urlCreator )
$urlCreator callable|null

                final public function urlCreator(?callable $urlCreator): static
{
    $new = clone $this;
    $new->urlCreator = $urlCreator;
    return $new;
}

            
urlParameterProvider() public method

public Yiisoft\Yii\DataView\BaseListView 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;
}

            
urlQueryParameters() public method

Return a new instance with query parameters of the route.

public Yiisoft\Yii\DataView\BaseListView 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;
}