panix/wgt-fancybox

为 Yii2 的 Fancybox 小部件

安装次数: 3,889

依赖: 1

建议者: 0

安全性: 0

星星: 0

关注者: 2

分支: 0

公开问题: 0

类型:pixelion-widget

1.3.2 2021-07-31 20:18 UTC

This package is auto-updated.

Last update: 2024-09-29 05:01:25 UTC


README

Yii2 小部件

Latest Stable Version Total Downloads Monthly Downloads Daily Downloads Latest Unstable Version License

安装

安装此扩展的首选方式是通过 Composer

运行以下命令之一:

php composer require --prefer-dist panix/wgt-fancybox

或者将以下内容添加到您的 composer.json 文件的 require 部分:

"panix/wgt-fancybox": "^1.3.0"

to the require section of your composer.json file.

使用方法

扩展安装后,只需在代码中通过以下方式使用它:

<?php
echo \panix\ext\fancybox\Fancybox::widget(['target' => 'a.fancybox-image']);

// or use options

echo \panix\ext\fancybox\Fancybox::widget([
    'target' => 'a.fancybox-image',
    'options' => [
        //..
        'onInit'=> new \yii\web\JsExpression('function(){
            console.log("Fancybox onInit");
        }')
    ]
]);

?>

链接