Showing posts with label yii2 detail view format html. Show all posts
Showing posts with label yii2 detail view format html. Show all posts

Tuesday, April 10, 2018

Yii2 Detail View

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;
            }
        ],
    ],
]);

Recent Update

yii2 session handling

use yii\web\Session; $session = Yii::$app->session; // start session $session->open(); // close session $session->close(); ...

Most Search