PHPackages                             coderius/yii2-pell-widget - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. coderius/yii2-pell-widget

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

coderius/yii2-pell-widget
=========================

Pell content editor widget for Yii2.

1.0.1(6y ago)39.7k↓25%MITPHPCI failing

Since Nov 17Pushed 6y ago2 watchersCompare

[ Source](https://github.com/coderius/yii2-pell-widget)[ Packagist](https://packagist.org/packages/coderius/yii2-pell-widget)[ Docs](https://github.com/jaredreich/pell)[ RSS](/packages/coderius-yii2-pell-widget/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Pell content WYSIWYG editor Widget for Yii2
===========================================

[](#pell-content-wysiwyg-editor-widget-for-yii2)

[![Latest Version](https://camo.githubusercontent.com/c3c22171b54892f498d464057069725d386931e638262e655f21284d57fda82d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f636f6465726975732f796969322d70656c6c2d7769646765742e7376673f7374796c653d666c61742d737175617265266c6162656c3d72656c65617365)](https://github.com/coderius/yii2-pell-widget/releases)[![Software License](https://camo.githubusercontent.com/f9deaf395c556e9b4b419aa3b0e29a527b5341dc97bc451fe7813aa70b44e563/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636f6465726975732f796969322d70656c6c2d776964676574)](LICENSE.md)[![Code Coverage](https://camo.githubusercontent.com/4d2aa0c21cb8ca170019d4b1142dff64de660f6fc76c3b85ef5600c25a1ca5b1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636f6465726975732f796969322d70656c6c2d7769646765742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/coderius/yii2-pell-widget/?branch=master)[![Code Quality](https://camo.githubusercontent.com/660bc3e65337c8d6b5054c1b4b10998d153fc39690a58945226e8cf894503ae1/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f7175616c6974792f672f636f6465726975732f796969322d70656c6c2d7769646765742e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/coderius/yii2-pell-widget/?branch=master)[![Code Intelligence Status](https://camo.githubusercontent.com/0a7b7d9e6444381754aa6dcc6827136a0d13becc6ec4a6e1f874eaae9ba8d1a6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636f6465726975732f796969322d70656c6c2d7769646765742f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)[![Build Status](https://camo.githubusercontent.com/6ac6c1a08a1e59d9b0f4546a3043ff9cfe968c1f04896917c841b6aa4624cd53/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f636f6465726975732f796969322d70656c6c2d7769646765742f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/coderius/yii2-pell-widget/build-status/master)[![Build Status travis](https://camo.githubusercontent.com/b4f1a7a3b4f457f4335fefac84bf0f685de91cfbac530443b818e5f48d5207fe/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6465726975732f796969322d70656c6c2d7769646765743f6c6162656c3d7472617669732532306275696c64267374796c653d666c61742d737175617265)](https://travis-ci.org/coderius/yii2-pell-widget)

Renders a [Pell WYSIWYG text editor plugin](https://github.com/jaredreich/pell) widget.

[![Live demo](https://raw.githubusercontent.com/jaredreich/pell/master/demo.gif?raw=true "Demo")](https://raw.githubusercontent.com/jaredreich/pell/master/demo.gif?raw=true)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
composer require coderius/yii2-pell-widget:"~1.0"

```

or add

```
"coderius/yii2-pell-widget" : "~1.0"
```

to the require section of your application's `composer.json` file.

Usage
-----

[](#usage)

For example to use the pell editor with a \[\[\\yii\\base\\Model|model\]\]:

```
echo Pell::widget([
   'model' => $model,
   'attribute' => 'text',
]);
```

Inside form without model:

```
$value = 'textarea some content';

echo \coderius\pell\Pell::widget([
   'name' => 'textarea-name',
   'value'  => $value,
   'clientOptions' =>[]
]);
```

The following example will used not as an element of form:

```
echo Pell::widget([
  'asFormPart'  => false,
  'value'  => $value,
  'clientOptions' =>[
      'onChange' => new JsExpression(
          "html => {
              console.log(html);
          },"
      )
  ]
]);
```

You can also use this widget in an \[\[\\yii\\widgets\\ActiveForm|ActiveForm\]\] using the \[\[\\yii\\widgets\\ActiveField::widget()|widget()\]\] method, for example like this:

```
use coderius\pell\Pell;
