20 lines
597 B
PHP
20 lines
597 B
PHP
<?php
|
|
/**
|
|
* @var \Illuminate\Database\Eloquent\Collection $news
|
|
*/
|
|
$entityRelation = new \kernel\EntityRelation();
|
|
?>
|
|
<?php foreach ($news as $new): ?>
|
|
<?php
|
|
$img = $entityRelation->getAdditionalPropertyByEntityId("post", $new['id'], 'photo');
|
|
?>
|
|
<div class="card">
|
|
<?php if ($img): ?>
|
|
<img src="<?= $img ?>" class="card-img-top"/>
|
|
<?php endif; ?>
|
|
<div class="card-body">
|
|
<h5 class="card-title"><?= $new['title'] ?></h5>
|
|
<p class="card-text"><?= $new['content'] ?></p>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|