the code.
DetailView::widget([
'model' => $model,
'attributes' => [
'vehicles_id',
'brand_id',
'vehicles_name',
'vehicles_url:url',
[
'attribute' => 'vehicles_logo',
'format' => 'html',
'value' => function($data) {
return Html::img('@CDN/' . $data->vehicles_logo, ['width' => 120]);
}
]
]
])
Other code:
DetailView::widget([
'model' => $model,
'attributes' => [
'vehicles_id',
'brand_id',
'vehicles_name',
'vehicles_url:url',
[
'attribute' => 'vehicles_logo',
'format' => 'image',
'value' => function($data) {
return $data->vehicles_logo;
}
]
]);
1.code is Error:
Object of class Closure could not be converted to string
in /Applications/MAMP/htdocs/xxxx.com/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer.php at line
298
2.code Error
strncmp() expects parameter 1 to be string, object given
in /Applications/MAMP/htdocs/xxxx.com/vendor/yiisoft/yii2/BaseYii.php at line
131
vehicles_logo is value : ‘vehicles/alfa-romeo/alfa-romeo-alfa-4c.jpg’
what is problem?