PHP code example of teamsisu / contao-greyify

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

    

teamsisu / contao-greyify example snippets



    Default:
    {{greyify::imagePath/UUID?width=x&height=x&mode=x}}  // returns an image tag with figure container
    
    SRC:
    {{greyify::src::imagePath/UUID?width=x&height=x&mode=x}}  // returns only the file path
    
    TAG:
    {{greyify::tag::imagePath/UUID?width=x&height=x&mode=x}}  // returns an image tag
    
    FIGURE:
    {{greyify::figure::imagePath/UUID?width=x&height=x&mode=x}}  // returns an image tag with figure container
    


    $image = Greyify::convert(imagePath/UUID?width=x&height=x&mode=x);  // returns only the path of the image

    $image = Greyify::getHTML(imagePath/UUID?width=x&height=x&mode=x);  // returns an image tag

    $image = Greyify::getHTML(imagePath/UUID?width=x&height=x&mode=x, true);  // returns an image tag with figure container