Answer the question
In order to leave comments, you need to log in
How to display value as rendered HTML in Yii2 DetailView?
Actually here is the code:
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id',
[
'attribute' => 'parent_id',
'value' => ($model->parent ?
Yii::t('app', 'This is parent category is: ').$model->parent->title :
Yii::t('app', 'This is parent category')
),
],
'title',
'url_tag:url',
'icon_code',
'mkeywords',
'mdescription:ntext',
],
]) ?>
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