Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting license key in params-local.php #50

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ add Font-awesome cdn for font-awesome plugin
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
```

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.
Expand Down
6 changes: 6 additions & 0 deletions src/FroalaEditorWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down