yii-starter-kit / yii2-glide
Yii2 Glide Extension
Package info
github.com/yii-starter-kit/yii2-glide
Type:yii2-extension
pkg:composer/yii-starter-kit/yii2-glide
Requires
- php: >=8.4
- intervention/image: ^3.0
- league/flysystem: ^3.0
- league/glide: ^3.0
- league/uri: ^7.0
- symfony/http-foundation: ^6.0|^7.0
- yiisoft/yii2: ^2.0.0
Requires (Dev)
- phpunit/phpunit: ^11.0
This package is auto-updated.
Last update: 2026-03-09 18:38:11 UTC
README
Yii2 Glide integration — forked and maintained by yii-starter-kit.
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
Contributing
You can contribute anything you found useful in any convenient way. Any help appreciated.
Installation
The preferred way to install this extension is through composer.
Either run
composer require --prefer-dist yii-starter-kit/yii2-glide
or add
"yii-starter-kit/yii2-glide": "^2.0"
to the require section of your composer.json file.
Usage
Add glide configuration:
'components' => [ ... 'glide' => [ 'class' => 'YiiStarterKit\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 YiiStarterKit\glide\actions\GlideAction to output images:
In any controller add (SiteController for example):
public function actions() { return [ 'glide' => 'YiiStarterKit\glide\actions\GlideAction' ] }
Than use it:
/index.php?r=site/glide?path=new-upload.jpg&w=100&h=75
Example
Complex Glide integration example can be found here
Secure Urls
TBD