1
Well, I have a carousel where I pick up the "images" (actually it’s just the names of the images) in the database and I do a foreach on the carousel but the images don’t appear. When I display the source code I see that the images are embedded in the pages and they see on the page no more shows the images on the carousel. What could be?
My merry-go-round:
<div id="content">
<div class="container no-padding">
<div class="row">
<!-- Carousel Slideshow -->
<div id="carousel-example" class="carousel slide" data-ride="carousel">
<!-- Carousel Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example" data-slide-to="1"></li>
<li data-target="#carousel-example" data-slide-to="2"></li>
</ol>
<div class="clearfix"></div>
<!-- End Carousel Indicators -->
<!-- Carousel Images -->
<?php
foreach ($imagem as $value) {
if ($value->imagem_status == true) {?>
<div class="item">
<img src="<?php echo base_url('tema/assets/img/site/'.$value->imagem_link) ?>">
</div>
<?php }
}
?>
</div>
<!-- End Carousel Images -->
<!-- Carousel Controls -->
<a class="left carousel-control" href="#carousel-example" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#carousel-example" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
<!-- End Carousel Controls -->
</div>
<!-- End Carousel Slideshow -->
</div>
</div>
I wonder if you have a solution for that.
And this variable class is what? $slide->class
– Natan Melo
this is a simplified if is the same thing as doing:
if($slide->class == 1){
 echo "<div class='item active ctrl'>";
}else{
 echo "<div class='item ctrl'>";
}
The class variable comes from the bank with value 1 or 0 to define which slide will be the first asset.– Marcos Souza