diff --git a/README.md b/README.md index 7432f86..3ae364e 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,13 @@ add Font-awesome cdn for font-awesome plugin ``` +To add the license key for the whole yii2-project add this to params-local.php: +```php +return [ + 'froala_license' => 'my-froala-license', +]; +``` + ## Upload example Using the basic Yii template make a new folder under /web/ called uploads. diff --git a/src/FroalaEditorWidget.php b/src/FroalaEditorWidget.php index 1bfa14f..cc57474 100644 --- a/src/FroalaEditorWidget.php +++ b/src/FroalaEditorWidget.php @@ -92,6 +92,12 @@ public function registerClientScript() if ($langType != 'es_gb') { $view->registerJsFile("{$asset->baseUrl}/js/languages/{$langType}.js", ['depends' => '\froala\froalaeditor\FroalaEditorAsset']); } + + // license key + if(isset(Yii::$app->params['froala_license'])){ + $this->clientOptions['key'] = Yii::$app->params['froala_license']; + $this->clientOptions['attribution'] = false; + } $id = $this->options['id']; if (empty($this->clientPlugins)) {