first commit
This commit is contained in:
20
frontend/views/news/index.php
Executable file
20
frontend/views/news/index.php
Executable file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use common\models\News;
|
||||
use yii\helpers\Url;
|
||||
|
||||
/** @var yii\web\View $this */
|
||||
/** @var News $news */
|
||||
?>
|
||||
<h1>Новости</h1>
|
||||
|
||||
<?php if (!empty($news)):
|
||||
foreach ($news as $new):
|
||||
?>
|
||||
<div>
|
||||
<a href="<?= Url::base() . '/new/' . $new->slug ?>"><?= $new->title ?></a>
|
||||
<p><?= $new->text ?></p>
|
||||
</div>
|
||||
<?php endforeach; else: ?>
|
||||
<h2>Новостей нет</h2>
|
||||
<?php endif; ?>
|
Reference in New Issue
Block a user