This is code for image slider with little bit text on image. This code showing images in a rows. But I want to make it slider. So, please help me.
<?php $isFirst = true; ?>
<?php foreach ($summaries as $key => $Summary){ ?>
<div class="item{{{ $isFirst ? ' active' : '' }}}">
<?php
if($Image){
?>
<?= $this->Html->image('../img/'.$Image[0]['Image']['name'],array('class' =>"img-responsive imgslider")); ?>
<?php } else{ ?>
<?= $this->Html->image('new_dummy.png',array('class'=>'img-responsive imgslider')); ?>
<?php }; ?>
<div class="carousel-caption" style="background:rgba(0,0,0,0.5)">
<h3><?= $Summary['Summary']['dhalao_id']? $Summary['Dhalao']['name'] : 'Root'; ?></h3>
<p>Quantity Report: <?= $Summary['Summary']['time_created'] ;?> && Time: <?= $Summary['Summary']['date_created']; ?></p>
</div>
</div>
<?php $isFirst = false; ?>
<?php }; ?>
Here, I created $isFirst
variable, what stays true until first slide has been printed. This way we can add active class for first slide and not for others.