PHP code example of amazeelabs / silverback_cloudinary
1. Go to this page and download the library: Download amazeelabs/silverback_cloudinary 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/ */
amazeelabs / silverback_cloudinary example snippets
addResolver('Page.heroImage',
$builder->compose(
// ...any other calls to data producers or callbacks that will return a string (image url), for example:
//$builder->callback(function ($value) {
// return 'http://www.example.com/demo.jpg';
//}),
$builder->produce('responsive_image')
->map('image', $builder->fromParent())
->map('width', $builder->fromArgument('width'))
->map('height', $builder->fromArgument('height'))
->map('sizes', $builder->fromArgument('sizes'))
->map('transform', $builder->fromArgument('transform'))
)
)
);