yiidoc / yii2-redactor

Extension Redactor WYSIWYG for Yii2 framework
BSD 3-Clause "New" or "Revised" License
186 stars 87 forks source link

uploadUrl not set from web.php configuration file #12

Open newscloud opened 9 years ago

newscloud commented 9 years ago

Hi, I'm writing a tutorial for Tuts+ about this module (see https://code.tutsplus.com/tutorials/programming-with-yii2-getting-started--cms-22440) ...

I'm finding that 'uploadUrl' => '/hello/uploads' is being ignored by the widget.
'modules' => [ 'redactor' => 'yii\redactor\RedactorModule', 'class' => 'yii\redactor\RedactorModule', 'uploadDir' => '@webroot/uploads', 'uploadUrl' => '/hello/uploads', ],

I had to manually change RedactorModule uploadUrl to get it to work: class RedactorModule extends \yii\base\Module {

public $controllerNamespace = 'yii\redactor\controllers';
public $defaultRoute = 'upload';
public $uploadDir = '@webroot/uploads';
public $uploadUrl = '/hello/uploads';

Any idea what I might be doing wrong?

Is there a way to extend the module from my own tree rather than making changes in your plugin vendor tree?

Thanks so much for a great plugin!

roma-glushko commented 8 years ago

Hi @newscloud , you have inited the module wrong. See the following example: ` 'modules' => [ 'redactor' => [ 'class' => 'yii\redactor\RedactorModule', 'uploadDir' => '@webroot/path/to/uploadfolder', 'uploadUrl' => '@web/path/to/uploadfolder', 'imageAllowExtensions'=>['jpg','png','gif'] ], ],

` The modules is an associative array and the redactor is a subarray of it.