I have a custom component that displays "coming soon" items based on dates. I am trying to hide all those items that are past today's date. However if there is no future items it does not display the custom text.
How do I do it inside a foreach loop? Or how can I insert php break? Or is there a better way of doing this?
<?php foreach ($this->items as $item) : ?>
<?php if($item->state ==1 && strtotime($item->event_date) > strtotime(JFactory::getDate())): ?>
<div class="cont">
<!-- Display values from DB -->
</div>
<?php elseif($item->state ==1 && strtotime($item->event_date) < strtotime(JFactory::getDate())): ?>
<!-- Dont display anything -->
<?php else: ?>
<div class="cont">
<!-- Display custom text -->
</div>
<?php endif; ?>
<?php endforeach; ?>