2017 © Pedro Peláez
 

yii2-extension yii2-elfinder

Yii2 Elfinder

image

serhatozles/yii2-elfinder

Yii2 Elfinder

  • Saturday, November 29, 2014
  • by serhatozles
  • Repository
  • 1 Watchers
  • 2 Stars
  • 66 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

elFinder

Yii2 Elfinder, (*1)

See: http://elfinder.org/, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require --prefer-dist serhatozles/yii2-elfinder "dev-master"

or add, (*5)

"serhatozles/yii2-elfinder": "dev-master"

to the require section of your composer.json file., (*6)

Usage

Once the extension is installed, simply use it in your code by :, (*7)

Add Main.php, (*8)

'controllerMap' => [
    'elfinder' => [
    'class' => 'serhatozles\elfinder\Controller',
//      'options' => [
////        'height' => 250,
////        'getFileCallback' => 'function(url) { alert(url); }',
//      'uiOptions' => [
//          'toolbar' => [
//          ['back', 'forward'],
//          ['netmount'],
//          ['upload'],
//          ['open', 'download', 'getfile'],
//          ['info'],
//          ['quicklook'],
//          ['rm'],
//          ['edit', 'resize'],
//          ['search'],
//          ['view', 'sort'],
//          ['help']
//          ]
//      ],
//      'contextmenu' => [
//          'navbar' => ['open', '|', 'info'],
//          'cwd' => ['reload', 'back', '|', 'upload', '|', 'sort', '|', 'info'],
//          'files' => ['getfile', '|', 'open', 'quicklook', '|', 'download', '|', 'rm', '|', 'edit', 'resize', '|', 'info']
//      ],
//      'onlyMimes' => ["image"],
//      ]
    ]
//    'elfinder2' => [
//  'class' => 'serhatozles\elfinder\Controller',
//  ...
//    ]
//    ...
],

View:, (*9)

    echo \serhatozles\elfinder\elFinder::widget([
    'ajax' => Url::to(['site/elfinder']),
//  'controller' => 'elfinder2',
//  'height' => 270,
    ]); 

Controller Action:, (*10)


public $enableCsrfValidation = false; public function actionElfinder() { $elFinder = new \serhatozles\elfinder\elFinder; echo $elFinder->connector([ // 'debug' => true, 'roots' => [ [ 'driver' => 'LocalFileSystem', // driver for accessing file system (REQUIRED) 'path' => Yii::getAlias('@webroot/files/'), // path to files (REQUIRED) 'URL' => Yii::getAlias('@web/files/'), // URL to files (REQUIRED) 'mimeDetect' => 'internal', 'onlyMimes' => ['image'], ], ] ]); }

The Versions

29/11 2014

dev-master

9999999-dev https://github.com/serhatozles/yii2-elfinder

Yii2 Elfinder

  Sources   Download

GPL-2.0+

The Requires

 

by Avatar serhatozles

extension yii2