PHPackages                             loveorigami/yii2-plugins-system - 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. loveorigami/yii2-plugins-system

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

loveorigami/yii2-plugins-system
===============================

Plugins system as WP for Yii2

3.1.5(7y ago)1143.0k231MITPHPPHP &gt;=5.5.0

Since Aug 2Pushed 7y ago19 watchersCompare

[ Source](https://github.com/loveorigami/yii2-plugins-system)[ Packagist](https://packagist.org/packages/loveorigami/yii2-plugins-system)[ RSS](/packages/loveorigami-yii2-plugins-system/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (9)Used By (1)

Getting started with Yii2-plugins-system
========================================

[](#getting-started-with-yii2-plugins-system)

[![Latest Stable Version](https://camo.githubusercontent.com/3786880e1468c990860dea61ab0102ccea786bbc19d0cb691cead722b60ebd21/68747470733a2f2f706f7365722e707567782e6f72672f6c6f76656f726967616d692f796969322d706c7567696e732d73797374656d2f762f737461626c65)](https://packagist.org/packages/loveorigami/yii2-plugins-system)[![Total Downloads](https://camo.githubusercontent.com/a893f9c1d69e7e211864f5218ba9030085f0816a1519727ea6f94ae9a3b08747/68747470733a2f2f706f7365722e707567782e6f72672f6c6f76656f726967616d692f796969322d706c7567696e732d73797374656d2f646f776e6c6f616473)](https://packagist.org/packages/loveorigami/yii2-plugins-system)[![License](https://camo.githubusercontent.com/076107f26aaf2a6730c809ec1104fad627cd63a112a8bce55bd9b5aae15a2fff/68747470733a2f2f706f7365722e707567782e6f72672f6c6f76656f726967616d692f796969322d706c7567696e732d73797374656d2f6c6963656e7365)](https://packagist.org/packages/loveorigami/yii2-plugins-system)

Yii2-plugins-system is designed to work out of the box. It means that installation requires minimal steps. Only one configuration step should be taken and you are ready to have plugin system on your Yii2 website.

[!["Plugins"](docs/img/tab_plugins.jpg)](docs/img/tab_plugins.jpg)

### 1. Download

[](#1-download)

Yii2-plugins-system can be installed using composer. Run following command to download and install Yii2-plugins-system:

```
composer require "loveorigami/yii2-plugins-system": ">=3.*"
```

### 2. Update database schema

[](#2-update-database-schema)

The last thing you need to do is updating your database schema by applying the migrations. Make sure that you have properly configured `db` application component, add in our console config namespace migration - [more here](http://www.yiiframework.com/doc-2.0/guide-db-migrations.html#namespaced-migrations)

```
return [
    'controllerMap' => [
        'migrate' => [
            'class' => 'yii\console\controllers\MigrateController',
            'migrationNamespaces' => [
                 ...
                'lo\plugins\migrations'
            ],
        ],
    ],
];
```

and run the following command:

```
$ php yii migrate
```

### 3. Configure application

[](#3-configure-application)

Let's start with defining module in `@backend/config/main.php`:

```
'modules' => [
    'plugins' => [
        'class' => 'lo\plugins\Module',
        'pluginsDir'=>[
            '@lo/plugins/core', // default dir with core plugins
            // '@common/plugins', // dir with our plugins
        ]
    ],
],
```

That's all, now you have module installed and configured in advanced template.

Next, open `@frontend/config/main.php` and add following:

```
...
'bootstrap' => ['log', 'plugins'],
...
'components' => [
    'plugins' => [
        'class' => lo\plugins\components\PluginsManager::class,
        'appId' => 1 // lo\plugins\BasePlugin::APP_FRONTEND,
        // by default
        'enablePlugins' => true,
        'shortcodesParse' => true,
        'shortcodesIgnoreBlocks' => [
            ']*>' => '',
            //'
