deviceDetect->isMobile(); $maxheight = $mobile?'900':'750'; if($gallery instanceof \app\models\front\Gallery && count($gallery->getBehavior('galleryBehavior')->getImages())>0 ){ $c = Yii::$app->acache; $c->set('fotorama', true); $i=1; ob_start(); foreach($gallery->getBehavior('galleryBehavior')->getImages() as $image){ $add_cap = ($image->name != '')?", caption: '".$image->name."'":''; if( ( $model->type == 2 || $model->type == 6 ) && !$mobile ){ // лонгрид $mainimg = $image->getUrl('large'); }else{ $mainimg = $image->getUrl('medium'); } if( $mainimg ){ ?> {img: '=$mainimg?>', thumb: '=$image->getUrl('small')?>', full:'=$image->getUrl('large')?>', id:=$i?> =$add_cap?>}, } $i++; } $ltext = ob_get_contents(); ob_end_clean(); /* */ ?>