1. Go to this page and download the library: Download sieulog/yii2-elfinder library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
sieulog / yii2-elfinder example snippets
'controllerMap' => [
'elfinder' => [
'class' => 'mihaildev\elfinder\Controller',
'access' => ['@'], //глобальный доступ к фаил менеджеру @ - для авторизорованных , ? - для гостей , чтоб открыть всем ['@', '?']
'disabledCommands' => ['netmount'], //отключение ненужных команд https://github.com/Studio-42/elFinder/wiki/Client-configuration-options#commands
'roots' => [
[
'baseUrl'=>'@web',
'basePath'=>'@webroot',
'path' => 'files/global',
'name' => 'Global'
],
[
'class' => 'mihaildev\elfinder\UserPath',
'path' => 'files/user_{id}',
'name' => 'My Documents'
],
[
'path' => 'files/some',
'name' => ['category' => 'my','message' => 'Some Name'] //перевод Yii::t($category, $message)
],
[
'path' => 'files/some',
'name' => ['category' => 'my','message' => 'Some Name'], // Yii::t($category, $message)
'access' => ['read' => '*', 'write' => 'UserFilesAccess'] // * - для всех, иначе проверка доступа в даааном примере все могут видет а редактировать могут пользователи только с правами UserFilesAccess
]
],
'watermark' => [
'source' => __DIR__.'/logo.png', // Path to Water mark image
'marginRight' => 5, // Margin right pixel
'marginBottom' => 5, // Margin bottom pixel
'quality' => 95, // JPEG image save quality
'transparency' => 70, // Water mark image transparency ( other than PNG )
'targetType' => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP, // Target image formats ( bit-field )
'targetMinPixel' => 200 // Target image minimum pixel size
]
]
],