use yii\widgets\DetailView; echo DetailView::widget([ 'model' => $model, 'attributes' => [ 'id', 'name', 'email:email', 'phone', [ 'attribute' => 'address', 'value' => $model->address->fullAddress, ], ], ]);
use yii\widgets\DetailView; echo DetailView::widget([ 'model' => $model, 'attributes' => [ [ 'label' => 'Title', 'value' => $model->title, ], [ 'label' => 'Author', 'value' => $model->author->name, ], [ 'label' => 'Description', 'value' => $model->description, 'format' => 'html', ], ], ]);This example displays the details of a book model, showing the title, author, and a description. The 'format' attribute is used to display the description as HTML. Package Library: This widget is part of the Yii Framework, which is an open-source PHP web application development framework.