yii2-lepture-markdown-editor-wid

Yii2 widget for Lepture Markdown Editor (https://github.com/lepture/editor) - A markdown editor you really want
2 followers

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
                ]
            ])

Total 2 comments

#17269 report it
iJackUA at 2014/05/18 03:32pm
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

#17267 report it
nirmalroka at 2014/05/18 12:09pm
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.

Leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet