zxbodya/yii2-elfinder

扩展,用于在Yii2应用程序中使用elFinder 1.x文件管理器

安装次数: 31,753

依赖者: 3

建议者: 1

安全性: 0

星标: 10

关注者: 5

分支: 11

公开问题: 4

语言:JavaScript

类型:yii2-extension

v2.0.0 2017-10-23 16:42 UTC

This package is not auto-updated.

Last update: 2024-09-22 07:31:30 UTC


README

扩展,用于简化将elFinder添加到Yii2项目。

扩展是基于Yii 1.1扩展重写的

https://github.com/zxbodya/yii-elfinder

## 安装

建议通过 composer 安装此扩展。

运行

php composer.phar require --prefer-dist zxbodya/yii2-elfinder "*@dev"

或添加

"zxbodya/yii2-elfinder": "*@dev"

到您的 composer.json 文件的 require 部分。

namespace backend\controllers;         
use Yii;       
use yii\web\Controller;         
use zxbodya\yii2\elfinder\ConnectorAction; 
      
class ElFinderController extends Controller         
{         
    public function actions()         
    {         
        return [         
            'connector' => array(         
                'class' => ConnectorAction::className(),         
                'settings' => array(         
                    'root' => Yii::getAlias('@webroot') . '/uploads/',                    
                    'URL' => Yii::getAlias('@web') . '/uploads/',         
                    'rootAlias' => 'Home',         
                    'mimeDetect' => 'none'         
                )                    
            ),         
        ];                    
    }         
}

后端控制器配置

小部件使用

FileInput

echo $form->field($model, 'filePath')->widget(
    ElFinderInput::className(),
    ['connectorRoute' => 'el-finder/connector',]
)

小部件,通过ElFinder弹出窗口选择服务器上的文件

echo ElFinderWidget::widget(
    ['connectorRoute' => 'el-finder/connector',]
)

ElFinderWidget

TinyMce集成