dev-master
9999999-devAdaptiveImages plugin for CakePHP 3
The Requires
- php >=5.4.16
- ps/image-optimizer dev-master
The Development Requires
AdaptiveImages plugin for CakePHP 3
PHP extension - Imagick, (*1)
sudo apt-get install php5-imagick
You can install this plugin into your CakePHP application using composer., (*2)
The recommended way to install composer packages is:, (*3)
composer require e2e4gu/adaptive-image-plugin
Add to /config/bootstrap.php, (*4)
Plugin::load('AdaptiveImages', ['autoload' => true, 'routes' => true]);
or, (*5)
Plugin::loadAll();
Add to main layout , (*6)
tag<?= $this->Html->script('AdaptiveImages.client_screen') ?>
Helper includes in controller. Helper need for change src images path from original to cached., (*7)
public $helpers = ['AdaptiveImages.AdaptiveImg'];
Helper syntax. Your also can use Html helper`s options if you need it:, (*8)
echo $this->AdaptiveImg->image('yourimage.jpg', ['semanticType' => 'original']);
You can add semanticTypes and resolutionBreakpoints in:, (*9)
<your_local_project_dir>/vendor/e2e4gu/adaptive-image-plugin/config/adaptive_image_config.php <your_local_project_dir>/config/adaptive_image_config.php
Config config syntax:, (*10)
<semanticType> => [ <breakpoint-001> => [ <scale-method> => [ <param-001> => <value-001> ] ] ]
AdaptiveImages plugin for CakePHP 3