PHPackages                             thecodeholic/yii2-grapesjs - 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. thecodeholic/yii2-grapesjs

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

thecodeholic/yii2-grapesjs
==========================

Grapesjs AssetBundle and widgets

v01.1.8(6y ago)73803[1 issues](https://github.com/thecodeholic/yii2-grapesjs/issues)[1 PRs](https://github.com/thecodeholic/yii2-grapesjs/pulls)MITJavaScript

Since Aug 31Pushed 2y ago2 watchersCompare

[ Source](https://github.com/thecodeholic/yii2-grapesjs)[ Packagist](https://packagist.org/packages/thecodeholic/yii2-grapesjs)[ RSS](/packages/thecodeholic-yii2-grapesjs/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (3)Versions (13)Used By (0)

Grapesjs AssetBundle and widgets
================================

[](#grapesjs-assetbundle-and-widgets)

Grapesjs AssetBundle, widgets and module

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist thecodeholic/yii2-grapesjs "^v0.1.0"

```

or add

```
"thecodeholic/yii2-grapesjs": "^v0.1.0"

```

to the require section of your `composer.json` file.

Configuration
-------------

[](#configuration)

Once the module is installed, you need to run migrations:

```
php yii migrate --migrationPath=@vendor/thecodeholic/yii2-grapesjs/migrations
```

And add module in your config `modules`

```
'modules' => [
    'grapesjs' => [
        'class' => \thecodeholic\yii2grapesjs\Module::class,
        // custom placeholder variables which will be added into richtext
        // default is empty array
        'grapesJsVariables' => [
            '{first_name}' => 'First Name',
            '{last_name}' => 'Last Name',
            '{age}' => 'Age',
        ]
    ],
    ...
]
```

Configuring AssetManager
------------------------

[](#configuring-assetmanager)

The package uses `Yii::$app->fs` so you need to configure `fs` component to be one of the available targets of `creocoder\flysystem`

Checkout its documentation if you want to specify different targets

And you need to install your desired target.

For example

```
composer require creocoder/yii2-flysystem
```

Using the widget in your own controller
---------------------------------------

[](#using-the-widget-in-your-own-controller)

If you do not want to use the module and integrate in your controller, you should add `JsonParser` in request parser's.

```
'request' => [
    'parsers' => [
        'application/json' => 'yii\web\JsonParser',
    ]
]
```

Display the widget in your view file.

```
