loveorigami / yii2-colorbox
This widget is wrapper for awesome jQuery plugin Colorbox
Installs: 9 222
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
- bower-asset/jquery-colorbox: *
This package is auto-updated.
Last update: 2024-11-21 21:04:17 UTC
README
A customizable lightbox jQuery plugin for Yii2 based on Colorbox.
Installation
The preferred way to install this extension is through composer.
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:
use lo\widgets\colorbox\Colorbox; <?= Colorbox::widget([ 'selector' => '.colorbox', 'clientOptions' => [ 'maxWidth' => 800, 'maxHeight' => 600, ], 'coreStyle' => 2 ]) ?>
Iframe
- In Form (parent view)
use lo\widgets\colorbox\Colorbox; echo Colorbox::widget([ 'coreStyle' => 3, 'reload' => true, 'selector' => '.iframe-page', 'clientOptions' => [ 'width' => '95%', 'height' => '95%', 'iframe' => true, 'fixed' => true, ], ])
<form> ... <a class="iframe-page" href="/site.com/admin/module/controller/update?id=1" title="edit child item" tabindex="-1"><i class="fa fa-pencil"></i> Edit child item</a> ... </form>
- In Iframe (child view)
use lo\widgets\colorbox\Colorbox; echo Colorbox::widget([ 'iframeTarget' => '.form-save, .form-cancel' ]);
<form> ... <button type="submit" class="btn btn-success form-save">Save</button> <button type="button" class="btn btn-default form-cancel">Cancel</button> ... </form>