Closed n3yang closed 7 years ago
Thanks to create the widget, it's very useful.
I found a Issue maybe, it's hard to change the URL of tinymce.min.js when using CDN. In the config file, i try to set the assetManager params, like this:
$config = [ ... 'components' => [ 'assetManager' => [ 'bundles' => [ // working. 'yii\web\JqueryAsset' => [ 'js' => ['//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js'] ], // working too, but got JS file in twice 'dosamigos\tinymce\TinyMceAsset' => [ 'js' => ['//cdn.bootcss.com/tinymce/4.4.0/tinymce.min.js'], ], ], ], ], ... ]
So, I read the JqueryAsset.php in /yii2/web/JqueryAsset.php, and edit the TinyMceAsset.php from:
class TinyMceAsset extends AssetBundle { public $sourcePath = '@vendor/tinymce/tinymce'; public function init() { parent::init(); $this->js[] = YII_DEBUG ? 'tinymce.js' : 'tinymce.min.js'; } }
to:
class TinyMceAsset extends AssetBundle { public $sourcePath = '@vendor/tinymce/tinymce'; public $js = [ 'tinymce.js' ]; }
the configure is working.
So, I think it's better to give a chance to config.
@n3yang I agree, I made the mistake of adding the config on init() is totally wrong. A PR would be more than welcome.
init()
This has been fixed
Thanks to create the widget, it's very useful.
I found a Issue maybe, it's hard to change the URL of tinymce.min.js when using CDN. In the config file, i try to set the assetManager params, like this:
So, I read the JqueryAsset.php in /yii2/web/JqueryAsset.php, and edit the TinyMceAsset.php from:
to:
the configure is working.
So, I think it's better to give a chance to config.