Youda
(Comm Dina777)
1
I get an error when I use a function to get the value of column and its working normally using Gridview what I’m doing wrong 
<?= DetailView::widget([
'model' => $model,
'attributes' => [
[
'label' => 'subject_type',
'value' => function($data){return Lookup::item("SubjectType",$data->subject_type);},
'filter' => Lookup::items('SubjectType'),
],
id,
subject_nature,
],
]) ?>
Yes because ‘value’ attribute is a real value or attribute name, as doc says
http://www.yiiframework.com/doc-2.0/yii-widgets-detailview.html#$attributes-detail
So your code should be:
<?= DetailView::widget([
'model' => $model,
'attributes' => [
[
'label' => 'subject_type',
'value' => 'Lookup::item("SubjectType",$model->subject_type);',
'filter' => Lookup::items('SubjectType'),
],
id,
subject_nature,
],
]) ?>
Youda
(Comm Dina777)
3
Thanks a lot You save my effort