Yii DataView Latte Help

DetailView

The detailView tag represents a DetailView widget>. It displays the details for an associative array or an abject; dataField tags determine which fields are displayed.

Parameters

The detailView tag has one parameter: an associative array or an object that contains the details to be displayed.

Parameter

Type

Description

$data

array(string, mixed)|object

The data whose details are to be displayed.

Configuration

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

Usage

The detailView tag encloses dataField tags.

{varType array|object $data} {detailView $data|header: 'User Details'} {dataField 'id'} {dataField 'username'} {dataField 'email'} {dataField label: 'Created At', value: fn($data) => date('Y-m-d', $data->created_at)} {/detailView}
Last modified: 19 May 2025