PHP code example of triawarman / yii2-richfilemanager
1. Go to this page and download the library: Download triawarman/yii2-richfilemanager 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/ */
triawarman / yii2-richfilemanager example snippets
use yii\web\Controller;
use triawarman\richFilemanager\FileManagerAction;
class MediaManagerController extends Controller
{
public function beforeAction($action) {
$this->enableCsrfValidation = false;
return parent::beforeAction($action);
}
public function actions() {
return[
'file-manager'=>[
'class' => FileManagerAction::className(),
'auth' => true, //INFO: Default true, you could pass this option
'serverConfig' => [
'options' =>[
"serverRoot" => true,
"fileRoot" => "/user_folder/"
]
],
]
];
}
}