Commit 149959cb886c07de93dcdf2bcaa78b03fe5d1924
1 parent
4055ab1d
Поменял логику работы виджета Parthenr 3
Showing
2 changed files
with
15 additions
and
21 deletions
Show diff stats
frontend/web/css/site.css
frontend/widgets/views/_parthnerList.php
... | ... | @@ -3,30 +3,23 @@ |
3 | 3 | * @var $data frontend\widgets\ParthnersList |
4 | 4 | */ |
5 | 5 | |
6 | +use common\models\Partner; | |
6 | 7 | use artbox\core\components\imagemanager\models\ImageManager; |
7 | -use yii\helpers\Url; | |
8 | - | |
8 | +use artbox\core\components\imagemanager\components\ImageManagerGetPath; | |
9 | 9 | |
10 | 10 | ?> |
11 | 11 | |
12 | 12 | <ul class="owl-carousel customers" > |
13 | - <?php ?> | |
14 | - <?php foreach ($data as $parthner):?> | |
15 | - | |
16 | - <?php | |
17 | - $logo = null; | |
18 | - if ($parthner->image) { | |
19 | - $logo_img = ImageManager::findOne($parthner->image->id); | |
20 | - if ($logo_img) { | |
21 | - $logo = $logo_img->getImagePathPrivate() ?? $logo; | |
22 | - } | |
23 | - } | |
24 | - $file = $logo; | |
25 | - ?> | |
26 | 13 | |
27 | 14 | |
28 | - <li class="item"> | |
29 | - <a target="_blank" href="<?= $parthner->link; ?>"><img src="<?= $file; ?>" alt=""></a> | |
30 | - </li> | |
31 | -<?php endforeach;?> | |
32 | - </ul> | |
33 | 15 | \ No newline at end of file |
16 | + <?php foreach ($data as $parthner):?> | |
17 | + <li class="item"> | |
18 | + <?php | |
19 | + $logo_img = ImageManager::findOne($parthner->image->id); | |
20 | + $logo = $logo_img->getImagePathPrivate(); | |
21 | + $logo = stristr($logo, '/storage'); | |
22 | + if ($logo === false) $logo = '/img/no-image.png'; | |
23 | + ?> | |
24 | + <a href="<?php echo $parthner->link; ?>"><img src="<?php echo $logo; ?>" alt="" class="img-responsive"></a> | |
25 | + </li> | |
26 | + <?php endforeach; ?> | ... | ... |