PHP code example of thelia / image-factory-module

1. Go to this page and download the library: Download thelia/image-factory-module 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/ */

    

thelia / image-factory-module example snippets


    /** @var \ImageFactory\Handler\FactoryHandler $factoryHandler */
    $factoryHandler = $this->getContainer()->get('image_factory.factory_handler');

    $image = ProductImageQuery::create()->findOne();
    $factoryCode = 'test';

    $url = $factoryHandler->getUrl($factoryCode, null, 'path/your/image');
    $url = $factoryHandler->getUrl($factoryCode, $image);

    $uri = $factoryHandler->getUri($factoryCode, null, 'path/your/image');
    $uri = $factoryHandler->getUri($factoryCode, $image);
shell
    php Thelia image-factory:generate-destination product-high,product-medium,product-small
shell
    php Thelia image-factory:generate-destination "*"
shell
    php Thelia image-factory:generate-destination product-high,product-medium,product-small --force
shell
    php Thelia image-factory:reload-factory