Reputation: 364
I use DetalView widget and I need <ВR> tag:
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'information:ntext',
[
'attribute' => 'text',
'value' => $model->getUserAttributes('getScientificWorks', 'text'),
],
],
])
?>
getUserAttributes returns string:
$string .= $item[$field] . ", ";
If instead of comma input <ВR>, then text will be like this: "text.. <ВR> ..text"
Upvotes: 2
Views: 3652
Reputation: 545
Try this
...........
[
'attribute' => 'text',
'value' => $model->getUserAttributes('getScientificWorks', 'text'),
'format' => 'raw',
],
............
The "raw" format tells Yii2 not to do anything with the output. So it will display any html tag.
Upvotes: 5
Reputation: 3818
You need to try to use format
property like as 'formate' => 'text'
.
........
[
'attribute' => 'text',
'value' => $model->getUserAttributes('getScientificWorks', 'text'),
'format' => 'text',
],
.........
Upvotes: 1