An open API service indexing awesome lists of open source software.

https://github.com/loveorigami/yii2-colorbox

This widget is wrapper for awesome jQuery plugin Colorbox
https://github.com/loveorigami/yii2-colorbox

colorbox widget yii2

Last synced: 2 months ago
JSON representation

This widget is wrapper for awesome jQuery plugin Colorbox

Awesome Lists containing this project

README

        

Colorbox Widget for Yii2
========================
A customizable lightbox jQuery plugin for Yii2 based on [Colorbox](http://www.jacklmoore.com/colorbox/).

Installation
------------
The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require "loveorigami/yii2-colorbox" "*"
```

or add

```
"loveorigami/yii2-colorbox" : "*"
```

to the require section of your application's `composer.json` file.

Usage
-----
* In view:

```php
use lo\widgets\colorbox\Colorbox;

= Colorbox::widget([
'selector' => '.colorbox',
'clientOptions' => [
'maxWidth' => 800,
'maxHeight' => 600,
],
'coreStyle' => 2
]) ?>
```

Iframe
-----
* In Form (parent view)

```php
use lo\widgets\colorbox\Colorbox;

echo Colorbox::widget([
'coreStyle' => 3,
'reload' => true,
'selector' => '.iframe-page',
'clientOptions' => [
'width' => '95%',
'height' => '95%',
'iframe' => true,
'fixed' => true,
],
])
```

```html

...
Edit child item
...

```

* In Iframe (child view)

```php
use lo\widgets\colorbox\Colorbox;

echo Colorbox::widget([
'iframeTarget' => '.form-save, .form-cancel'
]);
```

```html

...
Save
Cancel
...

```