PHP code example of ether / thumbro
1. Go to this page and download the library: Download ether/thumbro 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/ */
ether / thumbro example snippets
return [
'imageUrlModifier' => function ($url, $isRemoteAsset) {
// Replace the site's URL with the internal docker container name (web)
return str_replace(getenv('DEFAULT_SITE_URL'), 'web', $url);
},
];
twig
{{ craft.thumbro.picture(img, { width: 1000, height: 1000 }, { aboveFold: true }) }}