2017 © Pedro Peláez
 

yii2-extension yii2-pen

Content editor like Medium.com for yii-2 based on https://github.com/sofish/pen

image

andrew72ru/yii2-pen

Content editor like Medium.com for yii-2 based on https://github.com/sofish/pen

  • Wednesday, May 13, 2015
  • by andrew72ru
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Content editor like Medium.com for yii-2

Content editor like Medium.com for yii-2 based on https://github.com/sofish/pen, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist andrew72ru/yii2-pen "*"

or add, (*4)

"andrew72ru/yii2-pen": "*"

to the require section of your composer.json file., (*5)

Usage

Use this in Active Form., (*6)

There is two cases of usage., (*7)

First, for multiple string text (like textarea)., (*8)

This code add a editable section element to your form and make a p tag in there for each paragraph., (*9)

    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., (*10)

This code make a h1 tag with page-geader class an add editablecontent to there., (*11)

    use andrew72ru\pen\Pen;

    echo $form->field($model, 'title')->widget(Pen::className(), [
        'clientOptions' => [
            'inline' => true,
            'tag' => 'h1',
            'class' => 'page-header'
        ]
    ]);

The Versions

13/05 2015

dev-master

9999999-dev

Content editor like Medium.com for yii-2 based on https://github.com/sofish/pen

  Sources   Download

MIT

The Requires

 

by Avatar andrew72ru

extension yii2 editor wysiwyg content-editable