| Conditions | 4 |
| Paths | 5 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 56 | protected function renderDataCellContent($model, $key, $index) |
||
| 57 | { |
||
| 58 | $content = $this->emptyText; |
||
| 59 | $value = ArrayHelper::getValue($model, $this->attribute); |
||
| 60 | |||
| 61 | if (!empty($value)) { |
||
| 62 | $value = mb_substr($value, 0, 1) == '/' |
||
| 63 | ? mb_substr($value, 1) |
||
| 64 | : $value; |
||
| 65 | |||
| 66 | $src = is_callable($this->path) |
||
| 67 | ? call_user_func_array($this->path, [$value]) |
||
| 68 | : $this->path . $value; |
||
| 69 | |||
| 70 | $content = Html::img($src, $this->imgOptions); |
||
| 71 | } |
||
| 72 | |||
| 73 | return $content; |
||
| 74 | } |
||
| 75 | } |
||
| 76 |