PHP code example of femundfilou / kirby-image-snippet

1. Go to this page and download the library: Download femundfilou/kirby-image-snippet 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/ */

    

femundfilou / kirby-image-snippet example snippets


composer 

 snippet('image', ['image' => $page->images()->first()]); 

<div data-cover='<?= $page->images()->first()->toImageInterface()->toJson(); 

 snippet('image', ['image' => $page->images()->first(), 'ratio' => 1, 'dimensions' => [200]]); 

<div data-cover='<?= $page->images()->first()->toImageInterface(['ratio' => 1, 'dimensions' => [200]])->toJson(); 



return [
  'femundfilou.image-snippet' => [
    'placeholder' => [
        'width' => 50,
        'blur' => 10,
        'quality' => 50
    ],
    'defaults' => [
        'ratio' => 0,
        'quality' => 80,
        'blur' => 0,
        'grayscale' => false,
        'lazy' => false,
        'formats' => ['webp', 'jpg'],
        'dimensions' => [400, 800, 1140],
    ],
  ]
];