echotrue / yii2-markdown
实现markdown在线编辑器
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Language:JavaScript
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-12-21 21:08:35 UTC
README
Thank you for choosing this extension , enjoy it!!!
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: