| 1 | <?php |
||
| 5 | class ImageHelper |
||
| 6 | { |
||
| 7 | /** @var array $attributes Default attributes */ |
||
| 8 | protected $attributes = [ |
||
| 9 | 'alt' => null, |
||
| 10 | 'class' => null, |
||
| 11 | ]; |
||
| 12 | |||
| 13 | protected $options = [ |
||
| 14 | 'fit' => 'crop-center', |
||
| 15 | ]; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param $dir string Directory to search |
||
| 19 | * @param string $image Image name |
||
| 20 | * @param null $width |
||
| 21 | * @param null $height |
||
| 22 | * @param array $options |
||
| 23 | * |
||
| 24 | * @return string |
||
| 25 | */ |
||
| 26 | 3 | public function image($dir, $image, $width = null, $height = null, array $options = [], array $attributes = []) |
|
| 43 | |||
| 44 | /** |
||
| 45 | * @param $attributes |
||
| 46 | * |
||
| 47 | * @codeCoverageIgnore |
||
| 48 | * |
||
| 49 | * @return null|string |
||
| 50 | */ |
||
| 51 | protected function buildAttributes($attributes) |
||
| 64 | } |
||
| 65 |