Active slide yii

Good afternoon, how to install Active slide. You need to set the first image active. Please help a newbie

 > <!-- Carousel -->
>     <div id="main-slide" class="carousel slide" data-ride="carousel">
> 
>     <!-- Indicators -->
>     <ol class="carousel-indicators visible-lg visible-md">
>     <li data-target="#main-slide" data-slide-to="0" class="active"></li>
>     <li data-target="#main-slide" data-slide-to="1"></li>
>     <li data-target="#main-slide" data-slide-to="2"></li>
>     </ol>
>     <!--/ Indicators end-->
> 
>     <!-- Carousel inner -->
>     <div class="carousel-inner">
> 
>     <?php foreach($slides as $slide): ?>
>     <div class="item active" style="background-image: url(<?=$slide->img;?>);">
>     <div class="slider-content text-left">
>     <div class="col-md-12">
>     <h2 class="slide-title-box animated2"><?=$slide->sub_title;?></h2>
>     <h3 class="slide-title animated3"><?=$slide->title;?></h3>
>     <h3 class="slide-sub-title animated3"><?=$slide->description;?></h3>
>     </div>
>     </div>
>     </div>
>     <?php endforeach; ?>