alex290/yii2-gallery

管理画廊

安装次数: 127

依赖: 0

建议者: 0

安全性: 0

星标: 0

关注者: 2

分支: 0

开放问题: 0

类型:yii2-extension

0.1.2 2018-04-07 13:37 UTC

This package is auto-updated.

Last update: 2024-09-12 21:26:49 UTC


README

该扩展与 yii2-images 扩展一起使用。

安装

推荐通过 composer 安装此扩展。

使用命令安装

php composer.phar require --prefer-dist alex290/yii2-gallery "*"

或者

"alex290/yii2-gallery": "*"

composer.json 文件的 require 部分添加。

使用方法

use alex290\gallery\Gallery;

在文件上传字段之前启动小部件

<?php if (!$model->isNewRecord): ?>

    <div class="row">
        <?= Gallery::widget(['modelsImages' => $model]) ?>  
    </div>

<?php endif; ?>

如果要在单列中添加,请添加参数 'typeGalley' => 'pic'

结果将是

    <?= Gallery::widget(['modelsImages' => $model, 'typeGalley' => 'pic']) ?> 

并在 web.php 配置文件中指定

'modules' => [
    'yii2gallery' => [
        'class' => 'alex290\gallery\Module',
        'layout' => false,
    ],  
],