andrew72ru/yii2-pen
Composer 安装命令:
composer require andrew72ru/yii2-pen
包简介
Content editor like Medium.com for yii-2 based on https://github.com/sofish/pen
README 文档
README
Content editor like Medium.com for yii-2 based on https://github.com/sofish/pen
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist andrew72ru/yii2-pen "*"
or add
"andrew72ru/yii2-pen": "*"
to the require section of your composer.json file.
Usage
Use this in Active Form.
There is two cases of usage.
First, for multiple string text (like textarea).
This code add a editable section element to your form and make a p tag in there for each paragraph.
use andrew72ru\pen\Pen; echo $form->field($model, 'text')->widget(andrew72ru\pen\Pen::className());
Next case add a inline-editing feature – for headers and other one-line texts.
This code make a h1 tag with page-geader class an add editablecontent to there.
use andrew72ru\pen\Pen; echo $form->field($model, 'title')->widget(Pen::className(), [ 'clientOptions' => [ 'inline' => true, 'tag' => 'h1', 'class' => 'page-header' ] ]);
统计信息
- 总下载量: 15
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-05-09