Skip to content

Yii2 widget for lightboxed images based on Loker Dakar lightbox

Notifications You must be signed in to change notification settings

d1soft/Yii2-LightboxedImage-widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

yii2-lightboxedimage

Yii2 framework widget for lightboxed images.
It extension is wrapper for javascript lightbox coded by Lokesh Dakar

yii2-lightboxedimage

Installation

The preferred way to install is through composer.

Either run

php composer.phar require --prefer-dist d1soft/yii2-lightboxedimage "*"

or add

"d1soft/yii2-lightboxedimage": "*"

to the require section of your composer.json file.

Usage

View

	<?= LiteboxedImage::widget([
		'options' => [
			'src' => '/path/to/image.jpg',
			'lightboxId' => 'lightBox',
			'lightboxClass' => 'lightBoxClass',
			'lightboxStyle' => 'max-height: 350px',
			'imageId' => 'imageId',
			'imageClass' => 'imageClass',
			'imageStyle' => 'max-width: 250px',
			'title' => 'Image title',
			'alt' => 'Some image',
		 ], 
		 'clientOptions' => [
			'resizeDuration' => 200,
			'wrapAround' => true
		 ]
	]); ?>

Widget options

src

Image source path

alt

default: ''
Alternate image specified text

title

default: ''
Title image in lightbox

lightboxid

Lightbox id

lightboxClass

default: ''
Lightbox class

lightboxStyle

default: ''
Lightbox inline styles

imageId

default: ''
Image container id

imageClass

default: ''
Image container class

imageStyle

default: ''
Image container inline style

Client options

Client options you can see here