Skip to content

Commit 9fd306e

Browse files
author
Marcel Hauri
committed
this commit breaks BC, rename the imageResizerHelper to imageResizer
1 parent 459a247 commit 9fd306e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Plugin/View/Layout/Generator/Block.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct(Resizer $resizer)
2828
}
2929

3030
/**
31-
* Add image resizer helper object to all template blocks
31+
* Add image resizer object to all template blocks
3232
*
3333
* @param MagentoGeneratorBock $subject
3434
* @param $result
@@ -38,7 +38,7 @@ public function __construct(Resizer $resizer)
3838
public function afterCreateBlock(MagentoGeneratorBock $subject, $result) //@codingStandardsIgnoreLine
3939
{
4040
if (is_a($result, 'Magento\Framework\View\Element\Template')) {
41-
$result->addData(['image_resizer_helper' => $this->resizer]);
41+
$result->addData(['image_resizer' => $this->resizer]);
4242
}
4343
return $result;
4444
}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ $ composer require "staempfli/magento2-module-image-resizer":"~1.0"
1010

1111
## Usage
1212

13-
`ImageResizerHelper` is automatically available in all frontend Blocks.
13+
`imageResizer` is automatically available in all frontend Blocks.
1414
You can resize your images just calling a method:
1515

1616
```php
17-
/** @var \Staempfli\ImageResizer\Model\Resizer $resizerHelper */
18-
$resizerHelper = $block->getImageResizerHelper();
19-
$resizedImageUrl = $resizerHelper->resizeAndGetUrl(<originalImageUrl>, $width, $height, [$resizeSettings]);
17+
/** @var \Staempfli\ImageResizer\Model\Resizer $imageResizer */
18+
$imageResizer = $block->getImageResizer();
19+
$resizedImageUrl = $imageResizer->resizeAndGetUrl(<originalImageUrl>, $width, $height, [$resizeSettings]);
2020
```
2121

2222
You can do that directly on the .phtml or in your custom Block.

0 commit comments

Comments
 (0)