定制 andrew72ru/yii2-pen 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-09