PHP code example of dahromy / glide-symfony

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

    

dahromy / glide-symfony example snippets


use DahRomy\Glide\Service\GlideService;

class MyController extends AbstractController
{
    public function myAction(GlideService $glideService)
    {
        $imageUrl = $glideService->getImageUrl('path/to/image.jpg', ['w' => 300, 'h' => 200]);
        
        // Or get the image response directly
        $response = $glideService->getImageResponse('path/to/image.jpg', ['w' => 300, 'h' => 200]);
        
        // ...
    }
}