1. Go to this page and download the library: Download mmelcor/yii2-imagehandler 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/ */
mmelcor / yii2-imagehandler example snippets
'components' => [
'[other components]',
'imageHandler' => [
'class' => 'mmelcor\imagehandler',
'hostUrl' => '[your image repo base url]',
'siteFolder' => '[base folder]',
'defaultLang' => '[Language that will have all images]',
],
],
php composer.phar
protected $iHandler;
public function init() {
$this->iHandler = Yii::$app->imageHandler;
}
$this->parameters = [
'iHandler' => $this->iHandler,
]: