Skip to content

Commit 09007db

Browse files
committed
Merge pull request #191 from JavierJimenez/develop
Update README.md with instruction to create a cache image from controllers.
2 parents 52c6005 + 21fbabb commit 09007db

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ will apply your filter to '.jpg', and then concatenate the result to
374374

375375
## Using as a service
376376

377-
You can also use ImagineBundle as a service and create the cache image from controller.
377+
You can use ImagineBundle as a service and resolve the cached image path.
378378
```php
379379
$avalancheService = $this->get('imagine.cache.path.resolver');
380380
```
@@ -383,3 +383,10 @@ Then, call the getBrowserPath and pass the original image webpath and the filter
383383
```php
384384
$cachedImage = $avalancheService->getBrowserPath($object->getWebPath(), 'my_thumb');
385385
```
386+
387+
And also use ImagineBundle as a service and create the cache image from controller.
388+
```php
389+
$cacheManager = $this->get('imagine.cache.manager');
390+
$cachedPath = $cacheManager->cacheImage($this->getRequest()->getBaseUrl(), '/images/picture1.jpg', 'my_filter');
391+
```
392+

0 commit comments

Comments
 (0)