PHP code example of zxbodya / yii2-elfinder

1. Go to this page and download the library: Download zxbodya/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/ */

    

zxbodya / yii2-elfinder example snippets


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'         
                )                    
            ),         
        ];                    
    }         
}

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

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