Yii DataView Latte Help

GridView

The gridView tag represents a GridView widget>. It displays data in a grid layout, the columns of which are defined by the enclosed column tags.

Parameters

The gridView tag has one parameter:

Parameter

Type

Description

$dataReader

Yiisoft\Data\Reader\ReadableDataInterface

An instance of ReadableDataInterface.

Configuration

The gridView tag can be configured using the Latte filter syntax. A configuration filter has the name of the GridView configuration method and accepts the same type as the method's parameter; e.g. {gridView $data|header: 'Users'} will set the header of the GridView. The exception is methods that have variable-length argument lists; these must be passed as an array.

Usage

The gridView tag encloses xColumn tags.

{varType Yiisoft\Data\Reader\ReadableDataInterface $dataReader} {gridView $dataReader|header: 'Users'} {serialColumn} {dataColumn 'id'} {dataColumn 'username'} {dataColumn 'email'} {dataColumn 'created_at'} {checkboxColumn} {radioColumn} {actionColumn} {actionButton 'view', 'View'} {actionButton 'update', 'Edit'} {actionButton content: 'Delete', name: 'delete} {/actionColumn} {/gridView}
Last modified: 19 May 2025