gevman/yii2-file-manager

File Manager Module for Yii2

Installs: 86

Dependents: 0

Suggesters: 0

Security: 0

Stars: 8

Watchers: 1

Forks: 0

Open Issues: 0

Language:CSS

Type:project

2.3.2 2018-07-20 19:58 UTC

This package is auto-updated.

Last update: 2024-03-21 01:50:47 UTC


README

add this to web.php

'bootstrap' => [/* other, */'file-manager'/*, other*/],
// and
'modules' => [
    /* other, */
    'file-manager' => [
        'class' => Gevman\FileManager\Module::class,
        'returnFullPath' => false,
        'uploadFolder' => '/uploads',
        'allowedExtensions' => [
            'images' => ['jpg', 'png', 'gif'],
        ],
        'cacheComponent' => 'cache',
        'beforeAction' => function() {
            if (Yii::$app->user->isGuest) {
                throw new \yii\web\ForbiddenHttpException(Yii::t('yii', 'You are not allowed to perform this action.'));
            }
        }
    ],
    /*, other*
],

there is also console command for automating file thumb indexing

in console config set @webroot alias first after add this to config file

'bootstrap' => [/* other, */'file-manager'/*, other*/],
// and
'modules' => [
    /* other, */
    'file-manager' => [
        'class' => Gevman\FileManager\Module::class,
        'returnFullPath' => true,
        'uploadFolder' => '/uploads',
        'cacheComponent' => 'cache',
    ],
    /*, other*
],

after run `php yii file-manager/index-files`