DetailView is used to display the data by model. You can also use array instead of model.
You can also set $attribues property which columns you want to display using the detailView.
Detail View in Yii2
echo DetailView::widget([
'model' => $userModel,
'attributes' => [
[
'attribute' => 'user',
'value' => function ($data) {
return $data->user->name;
}
],
],
]);
Really awesome blog. Your blog is really useful for me. Thanks for sharing this informative blog. Keep update your blog.
ReplyDeletePHP Coders in India