There is a DetalView widget:

<?= DetailView::widget([ 'model' => $model, 'attributes' => [ 'information:ntext', [ 'attribute' => 'text', 'value' => $model->getUserAttributes('getScientificWorks', 'text'), ], ], ]) ?> 

The getUserAttributes method returns a string:

 $string .= $item[$field] . ", "; 

If instead of a comma to insert a line break tag, it will appear as "text <ВR> text" Actually, I need to insert a line break.

  • If between attribute and value insert 'format'=>'raw', will it help? - Alexey Shimansky
  • @ Alexey Shimansky yes, thank you. Did not find the description and example options. - Zhi V

1 answer 1

You need the raw parameter; it does not filter the data and displays as it is.

html (html purified) or raw (not encode anything).

  • Well, in more detail what ... Or format. Well, at least in Russian ... - Qwertiy