PHP code example of diesdasdigital / kirby-3-imgix

1. Go to this page and download the library: Download diesdasdigital/kirby-3-imgix 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/ */

    

diesdasdigital / kirby-3-imgix example snippets


return [
  'imgix' => true,
  'imgix.domain' => 'https://project-name.imgix.net/',
  'imgix.defaults' => [
    'auto' => 'compress',
  ],
];

$page->someImage()->image()->thumb([
  'blur' => '10',
  'con' => '40',
])->url();

$page->someImage()->toFile()->srcset([300, 800, 1024])

// with additional parameters
$page->someImage()->toFile()->srcset([
  300 => [
    'width' => 300,
    'crop' => 'top,left'
  ],
  500 => [
    'width' => 500
  ]
])