yii2-test-1/frontend/views/news/text.php

21 lines
440 B
PHP
Raw Permalink Normal View History

2023-05-06 20:40:02 +03:00
<?php
use common\models\Text;
/** @var yii\web\View $this */
/** @var Text[] $texts */
?>
<h1>Тексты</h1>
<?php if (!empty($texts)):
foreach ($texts as $text):
?>
<div>
<h2><?= $text->title ?></h2>
<p><?= $text->text ?></p>
<img src="<?= '/uploads/' . $text->profile->image ?>"
</div>
<?php endforeach; else: ?>
<h2>текстов нет</h2>
<?php endif; ?>