Closed kongoon closed 5 years ago
Current stage doesn't allow that without some extra work.
You could create your own module to override module init
function like that:
namespace backend\modules\myckeditoroxyfileman;
use nickdenry\ckeditorRoxyFileman\Module as BaseModule;
class Module extends BaseModule
{
/**
* Initializes the module, set uploadFolder dynamically
*/
public function init()
{
$this->uploadFolder = '@frontend/web/whatever/'.Yii::$app->user->id.'/whatever';
parent::init();
}
}
And your config:
'modules' => [
'ckeditorRoxyFileman' => [
'class' => 'backend\modules\myckeditoroxyfileman\Module',
'uploadFolder' => '',
'uploadUrl' => '/uploads/images',
],
],
Check if that helps. Or you could use closure if config uploadFolder
param is matter to you.
i'm try but error 404 /default but i'm fixed
namespace backend\modules\fileman;
use nickdenry\ckeditorRoxyFileman\Module as MyBaseModule;
use Yii;
class Module extends MyBaseModule
{
public $controllerMap = [
'default' => [
'class' => 'nickdenry\ckeditorRoxyFileman\controllers\DefaultController',
'viewPath' => '@vendor/nick-denry/yii2-ckeditor-roxyfileman/src/views/default'
],
'management' => [
'class' => 'nickdenry\ckeditorRoxyFileman\controllers\ManagementController',
'viewPath' => '@vendor/nick-denry/yii2-ckeditor-roxyfilename/src/views/management'
]
];
/**
* Initializes the module, set uploadFolder dynamically
*/
public function init()
{
$this->layoutPath = '@vendor/nick-denry/yii2-ckeditor-roxyfileman/src/views/layouts';
$this->uploadFolder = '@backend/web/uploads/files/'.Yii::$app->user->getId();
$this->uploadUrl = '@web/uploads/files/'.Yii::$app->user->getId();
parent::init();
}
}
@kongoon Do you solve this issue completely?
How to set upload folder for multiple user or show only own uploaded file?