PHP code example of newism / craft-imgix

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

    

newism / craft-imgix example snippets



## Usage

This plugin is a drop-in replacement for Craft CMS native [image transforms](https://craftcms.com/docs/5.x/development/image-transforms.html) and [.srcset()](https://craftcms.com/docs/5.x/development/image-transforms.html#generating-srcset-sizes) method.

You shouldn't have to update any of your templates unless you want to add additional imgix parameters.

### Adding additional transform parameters

In addition to the standard Craft CMS transform options:

* `mode`
* `width`
* `height`
* `quality`
* `format`
* `position`
* `fill`

This plugin adds a `ratio` option which allows you to set the aspect ratio of the image. This will automatically
set the `mode` to `crop` and use the image's width and focal point.

shell
composer 
shell
cp vendor/newism/craft-imgix/src/config.php config/newism-imgix.php