Yii2 Glide Extension

Installs: 216 648

Dependents: 16

Suggesters: 1

Security: 0

Stars: 41

Watchers: 7

Forks: 22

Open Issues: 5


1.2.2 2018-04-26 11:16 UTC

This package is auto-updated.

Last update: 2023-09-12 23:35:31 UTC


Yii2 Glide integration.

Glide is a wonderfully easy on-demand image manipulation library written in PHP.

Before you start read Glide documentation to understand what we are doing


Since this package was created as a part of yii2-starter-kit it's demo can be found in starter kit demo.


You can contribute anything you found useful in any convenient way. Any help appreciated.


The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist trntv/yii2-glide

or add

"trntv/yii2-glide": "^1.0"

to the require section of your composer.json file.


Add glide configuration:

'components' => [
    'glide' => [
        'class' => 'trntv\glide\components\Glide',
        'sourcePath' => '@app/web/uploads',
        'cachePath' => '@runtime/glide',
        'signKey' => '<random-key>' // "false" if you do not want to use HTTP signatures

Then you can output modified image like so:

Yii::$app->glide->outputImage('new-upload.jpg', ['w' => 100, 'fit' => 'crop'])

You can also use trntv\glide\actions\GlideAction to output images: In any controller add (SiteController for example):

public function actions()
    return [
        'glide' => 'trntv\glide\actions\GlideAction'

Than use it: /index.php?r=site/glide?path=new-upload.jpg&w=100&h=75


Complex Glide integration example can be found here

Secure Urls