d1f8bd40
Alexey Boroda
first commit
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<?php
namespace frontend\modules\partners;
use Yii;
/**
* Class Partners
*
* @package frontend\modules\partners
* @author Alla Kuzmenko
* @copyright (c), Thread
*/
class Partners extends \common\modules\partners\Partners
{
/**
* Number of elements in GridView
* @var int
*/
public $itemOnPage = 20;
/**
* @param $image_link
* @return null|string
*/
public static function getImageLinkForItem($image_link)
{
$module = Yii::$app->getModule(self::name);
$path = $module->getItemUploadPath();
$url = $module->getItemUploadUrl();
return (!empty($image_link) && is_file($path . '/' . $image_link))
? $url . '/' . $image_link
: null;
}
}
|