PHP code example of mostlyserious / craft-imgix-picture

1. Go to this page and download the library: Download mostlyserious/craft-imgix-picture 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/ */

    

mostlyserious / craft-imgix-picture example snippets




return [
    'imgixApiKey' => getenv('IMGIX_API_KEY'),
    'volumes' => [
        /** Settings for the "Uploads" volume */
        'uploads' => [
            'imgixSourceUrl' => getenv('IMGIX_SOURCE_URL'),
            // 'useNativeTransforms' => false /* optional */
            // 'altTextHandle' => 'alternativeText' /* optional */
        ],
        /** Settings for the other volumes */
        // 'volumeHandle' => [
        // ...
        // ],
    ],
    // 'defaultParameters' => [] /* optional */
    // 'fallBackImageSrc' => '/static-assets/default-image-missing-photo.png' /* optional */
];



return [
    'imgixApiKey' => getenv('IMGIX_API_KEY'),
    'imgixUrl' => getenv('IMGIX_URL'),
    // 'useNativeTransforms' => false /* optional */
    // 'altTextHandle' => 'alternativeText' /* optional */
    // 'defaultParameters' => [] /* optional */
    // 'fallBackImageSrc' => '/static-assets/default-image-missing-photo.png' /* optional */
];

    /* Defaults are */
    [
        'auto' => 'format,compress',
        'q' => 35,
        'fit' => 'max',
    ];