PHP code example of 3brs / imgproxy-bundle
1. Go to this page and download the library: Download 3brs/imgproxy-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
3brs / imgproxy-bundle example snippets
return [
// ...
ThreeBRS\ImgproxyBundle\ThreeBRSImgproxyBundle::class => ['all' => true],
];
twig
{# Works exactly as before #}
<img src="{{ asset('/media/image.jpg')|imagine_filter('thumbnail') }}" />
{# With responsive images #}
<picture>
<source srcset="{{ asset('/media/image.jpg')|imagine_filter('thumbnail_webp') }}" type="image/webp">
<img src="{{ asset('/media/image.jpg')|imagine_filter('thumbnail') }}" />
</picture>