Answer the question
In order to leave comments, you need to log in
How to return html markup using a function?
For a single column in a GridView, the function returns the following:
[
'attribute' => 'file',
'format' => 'html',
'label' => 'File',
'value' => function($data){
if (!FileTypeManager::isPDFType('@fileManager/' . $data['file'])) {
return Html::img('@fileManager/' . $data['file'], ['width' => '150px']);
}else{
return Html::img('@serverFiles/' . 'server_pdf.png', ['width' => '150px']);
}
}
],
<div class="row">
<div class="col-lg-6">
<div class="input-group">
<input disabled="false" type="text" class="form-control" placeholder="Search for...">
<span class="input-group-btn">
<button class="btn btn-default" type="button" >Copy</button>
</span>
</div>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Similar
'value' => function($data){
return '<div>Любой код</div>';
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question