| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function render($value) { |
||
| 23 | if ($this->isImage($value)) { |
||
| 24 | return (string)new Element('img', [ |
||
| 25 | 'title' => $value->getName(), |
||
| 26 | 'src' => $this->createUrl($value), |
||
| 27 | 'style' => 'max-height:' . $this->maxHeight(), |
||
| 28 | ]); |
||
| 29 | } |
||
| 30 | |||
| 31 | return (string)new Element('a', [ |
||
| 32 | 'download' => $value->getName(), |
||
| 33 | 'href' => $this->createUrl($value), |
||
| 34 | 'target' => '_blank' |
||
| 35 | ], [ |
||
| 36 | $value->getName() |
||
| 37 | ]); |
||
| 38 | } |
||
| 39 | |||
| 51 | } |