php - how to use function in DetailView yii2 -
**i use model function in detail view how use function in detail view ** <?= detailview::widget([ 'model' => $model, 'attributes' => [ 'title', 'demand', 'sell_for', 'property_category', 'detail', [ 'attribute' => 'dealer_id', 'format'=>'raw', 'value'=> function ($model) { return dealer::getname($model->dealer_id); } ], ], ]) ?>
**i use model function in detail view how use function in detail view **
in detailview value don't need anonymous function assign ..
[ 'attribute' => 'dealer_id', 'format'=>'raw', 'value'=> dealer::getname($model->dealer_id); ],
Comments
Post a Comment