 <?php

 Yii::app()->setLanguage(isset(Yii::app()->session['lang']) ? Yii::app()->session['lang'] : 'ar'); 
 $lang=Yii::app()->getLanguage();
 
?>
 
 <div class="container">
    <div class="row">
    <?php
        $articles=Article::model()->findAllByAttributes(array('featured'=>1),array('limit'=>2));
        $i=1;
        foreach($articles as $article)
        {

    ?>
     <div class="col-sm-6 col-xs-12">
          
             <div class="card-service" id="service<?php echo $i?>">
                 <div class="img-container">
                     <img  class="img-responsive center-block img-service" src="<?php echo ($article->image!=null?(Yii::app()->request->baseUrl."/uploads/Article/".$article->image):(Yii::app()->request->baseUrl."/images/image_not_found.png"));?>" alt="service<?php echo $i?>">
                 </div>
                 <a href="<?php echo Yii::app()->request->baseUrl.'/article/view/slug/'.$article->slug ?>">
                 <div class="service-text">
                     <h2 class="head-text"> 
                     <?php echo ($lang=='en'?$article->en_title:$article->title);?> 
                     </h2>
                     <h3 class="sub-text"> 
                     <?php echo ($lang=='en'?$article->description_en :$article->description_ar);?>
                     </h3>
                 </div>
                 </a>
             </div> 
        </div> 
        
        <?php
        $i++;
        }
        ?>
 

     </div>
 </div>