Skip to content

echotrue/yii2-markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An Online Editor Extension For Yii Framework Version 2

Thank you for choosing this extension , enjoy it!!!

Latest Stable Version Total Downloads Latest Unstable Version License Monthly Downloads Daily Downloads composer.lock

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist echotrue/yii2-markdown "*"

or add

"echotrue/yii2-markdown": "*"

to the require section of your composer.json file . and run this command:

composer update

Usage

Add an actions() method in controller

public function actions()
    {
        return [
            'upload'  => [
                'class' => 'echotrue\markdown\UploadAction',
            ],
        ];
    }

used in view :

<?= $form->field($model, 'username')->widget(\echtrue\markdown\MarkDown::className(), [
        'options'    => ['id' => 'yii-markdown','width'=>'1000px'],
        'model'      => $model,
        'attribute' => 'username',
    ]) ?>

or

<?= \echotrue\markdown\MarkDown::widget([
        'options' => [
            'id' => 'yii-markdown',
            //'height'=>"100px",
        ],
        'name'    => 'username',
    ]); ?>
    

upload path :

create a new folder which named markdown_upload in webroot

configuration

width: height: