- Links
- Demo
- Installation via Composer
- Usage example
- Editor options
- Marked options (markdown parser used by Lepture Editor)
Yii2 widget for Lepture Markdown Editor (https://github.com/lepture/editor) - A markdown editor you really want
Links ¶
Demo ¶
on http://lab.lepture.com/editor/
Installation via Composer ¶
add to require
section of your composer.json
"ijackua/yii2-lepture-markdown-editor-widget"
and run composer update
Usage example ¶
Active widget ¶
use ijackua\lepture\Markdowneditor;
Markdowneditor::widget(
[
'model' => $model,
'attribute' => 'full_text',
])
Simple widget ¶
use ijackua\lepture\Markdowneditor;
Markdowneditor::widget(
[
'name' => 'editor',
'value' => '# Hello world'
])
Editor options ¶
see on official site
use ijackua\lepture\Markdowneditor;
Markdowneditor::widget(
[
'model' => $model,
'attribute' => 'full_text',
'leptureOptions' => [
'toolbar' => false
]
])
Marked options (markdown parser used by Lepture Editor) ¶
see on official Marked site
use ijackua\lepture\Markdowneditor;
Markdowneditor::widget(
[
'model' => $model,
'attribute' => 'full_text',
'markedOptions' => [
'tables' => false
]
])
Error when using this widget
I had updated the composer
and I when I tried to use it like this
use ijackua\epiceditor\Epiceditor; public static function getEditor($form,$model,$attr){ return Epiceditor::widget([ 'model' => $model, 'attribute' => $attr, 'options' => ['focusOnLoad' => true], 'divHtmlOptions' => ['class' => 'epiceditordiv'] ]); }
get error
Class 'ijackua\epiceditor\Epiceditor' not found
Any idea what I am missing.
Maybe you are missing some point with Composer or Namespaces
I hope my answer in yii2-epiceditor-widget thread will help you
http://www.yiiframework.com/extension/yii2-epiceditor-widget/#c17268
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.