amilna / yii2-elevatezoom
Elevatezoom widget for Yii2
Installs: 11 384
Dependents: 2
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 9
Open Issues: 1
Language:JavaScript
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-12-21 17:53:50 UTC
README
An elevate zoom widget for Yii2 based on Elevate Zoom.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require "amilna/yii2-elevatezoom" "*"
or add
"amilna/yii2-elevatezoom" : "*"
to the require section of your application's composer.json
file.
Usage
in View
use amilna\elevatezoom\ElevateZoom;
$images = ['an url of zoom image 1','an url of zoom image n'];
echo ElevateZoom::widget([
'images'=>$images,
'baseUrl'=>Yii::$app->urlManager->baseUrl.'/upload',
'smallPrefix'=>'/.thumbs',
'mediumPrefix'=>'',
]);
/* //or another example set 'images' with 3 dimension array:
$images'= [
[
'image'=>'an url of zoom image 1',
'small'=>'an url of gallery display image 1',
'medium'=>'an url of basic display image 1'
],
[
'image'=>'an url of zoom image n',
'small'=>'an url of gallery display image n',
'medium'=>'an url of basic display image n'
],
];
echo ElevateZoom::widget([
'images'=>$images,
]);
*/
'images' is array of images (1 or 3 dimensions, if 1 dimensions then you should set baseUrl, smallPrefix and mediumPrefix) or activeDataProvider (if activeDataProvider you should set imageKey, smallKey and mediumKey)
available options:
- images
- css (custom css)
- baseUrl (string basic replacer of image url)
- smallPrefix (string replacer to get small size image url)
- mediumPrefix (string replacer to get medium size image url)
- imageKey (model atribute that store zoom size image)
- smallKey (model atribute that store small size image)
- mediumKey (model atribute that store medium size image)
- targetId (custom container id)
- options (please see examples)