Download the PHP package borales/yii2-medium-editor without Composer
On this page you can find all versions of the php package borales/yii2-medium-editor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download borales/yii2-medium-editor
More information about borales/yii2-medium-editor
Files in borales/yii2-medium-editor
Package yii2-medium-editor
Short Description Medium editor widget for Yii2
License MIT
Homepage https://github.com/Borales/yii2-medium-editor
Informations about the package yii2-medium-editor
Medium Editor for Yii2
Renders Medium.com WYSIWYG editor (yabwe/medium-editor) widget.
- Changelog
- Installation
- Assets
- Usage
- External plugins
- Licence
Installation
The preferred way to install this extension is through composer.
Either run
or add
to the require
section of your composer.json
file.
Assets
By default - this extension doesn't provide any source files for Medium Editor itself. It uses public CDN instead (jsdelivr.com). And by default - it uses the latest version of the Medium Editor plugin.
However, you can change these settings by checking the following configuration of your application (config/main.php
):
The default specified version for Medium Editor plugin is
5.22.1
.
In case if you want to use Medium Editor plugin from local sources - you can do that
by adding bower-asset/medium-editor
package to your composer.json
file and adding this line
to your local configuration:
Usage
as a standalone widget for a Model
as a standalone widget for a custom variable
as a widget with extra Medium Editor settings
Here you can check the full list of Medium Editor options.
as an ActiveForm widget
as an ActiveForm widget with settings
as an ActiveField method (via MediumEditorTrait
)
In case if you use your custom ActiveField
class - you can use MediumEditorTrait
in your class:
And after that - call mediumEditor()
method to render Medium Editor widget like this
(and you can also pass Medium Editor settings as in above examples):
External plugins
If you want to use external plugin, which does not refer to the toolbar button (such as
medium-editor-insert-plugin),
you need to use plugins
property of the Widget and pass your code like this:
selector
andeditor
variables will be passed to the callback inside of the Widget's render method.
License
MIT License. Please see License File for more information.