PHP code example of aditiya / yii2-easyfilemanager
1. Go to this page and download the library: Download aditiya/yii2-easyfilemanager 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/ */
aditiya / yii2-easyfilemanager example snippets
'modules' => [
...
'efm' => [
'class' => 'aditiya\easyfilemanager\Module', // Module class
'usedemo' => true, // if you want to use demo
],
...
]
use aditiya\easyfilemanager\interfaces\EasyfilemanagerInterface;
use aditiya\easyfilemanager\traits\EasyfilemanagerTrait;
class ModelExample extends Model implements EasyfilemanagerInterface {
use EasyfilemanagerTrait;
...
public function getFileUrl()
{
return $this->getEfmFileUrl($this->filekey);
}
public function uploadFile()
{
$is_uploaded = $this->uploadEfmByInstance('filekey');
if($is_uploaded){
$this->filekey = $is_uploaded;
return true;
}
return false;
}
public function deleteFile()
{
return $this->deleteEfm($this->filekey);
}
...
}
$model = new Easyfilemanager();
$model->rolelists = ['admin','writer'=>1,'editor'=>[2,3,4]];
php composer.phar
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.