Answer the question
In order to leave comments, you need to log in
How to display html-code from the database, code?
How can you display a field from the database that stores the html code and get this code not as a string value, but as an html code?!
Here is the page code when we view the product:
<?php $img = $model->getImage(); ?>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
'title',
// 'block_img',
[
'attribute' => 'imgbl',
'value' => Html::img('@web/img/upload/' . $img->filePath , ['class' => 'admin__img-view']),
'format' => 'html',
],
'block_svg',
'svg:ntext', // поле для вывода html-кода
],
]) ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question