Answer the question
In order to leave comments, you need to log in
How to display text like $this->title in yii2?
The text should appear below the title.
on the page through the editor.$this->title = 'бла бла бла';
<?= Html::tag('h1', Html::encode($this->title), ['class' => 'flex-column logo--title']) ?>
<span>Вот сюда и нужно вывести динамически текст</span>
<h1>бла бла бла</h1>
<span>Вот сюда и нужно вывести динамически текст</span>
Answer the question
In order to leave comments, you need to log in
usually this dynamic text is taken from somewhere - it is passed to the view from the outside.
but for example -
<?php $text = 'Вот сюда и нужно вывести динамически текст';
?>
<?= Html::tag('h1', Html::encode($this->title), ['class' => 'flex-column logo--title']) ?>
<span><?= $text ?></span>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question