F
F
FrelFrloich2019-04-25 18:55:20
Yii
FrelFrloich, 2019-04-25 18:55:20

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>

on the page through the panel.
<h1>бла бла бла</h1>
<span>Вот сюда и нужно вывести динамически текст</span>

In general, you need to substitute the text dynamically according to the title type, since it is not semantically related to the title, I can’t put it there ...
Tell me how to do this, although the question is easy, but I just stuck on it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Decadal, 2019-04-25
@FrelFrloich

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>

the question is loosely framework related - it's basic work with php variables and output to stdstream.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question