ElFinder 1.x Yii2 extension
Extension to simplify adding elFinder to Yii2 project., (*1)
Extension is rework from Yii 1.1 extension:, (*2)
https://github.com/zxbodya/yii-elfinder, (*3)
Installation
The preferred way to install this extension is through composer., (*4)
Either run, (*5)
php composer.phar require --prefer-dist zxbodya/yii2-elfinder "*@dev"
, (*6)
or add, (*7)
"zxbodya/yii2-elfinder": "*@dev"
, (*8)
to the require section of your composer.json
file., (*9)
Backend controller configuration
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'
)
),
];
}
}
widget to choose file on server using ElFinder pop-up, (*10)
echo $form->field($model, 'filePath')->widget(
ElFinderInput::className(),
['connectorRoute' => 'el-finder/connector',]
)
echo ElFinderWidget::widget(
['connectorRoute' => 'el-finder/connector',]
)
TinyMce integration
Widgets supports intergation with TinyMce wysiwyg editor
For more details see tinymce extension https://github.com/zxbodya/yii2-tinymce, (*11)