PHPackages                             panix/mod-plugins - 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. panix/mod-plugins

ActivePixelion-module[Utility &amp; Helpers](/categories/utility)

panix/mod-plugins
=================

Module plugins

02511PHP

Since Sep 6Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/andrtechno/mod-plugins)[ Packagist](https://packagist.org/packages/panix/mod-plugins)[ RSS](/packages/panix-mod-plugins/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (1)

Getting started with mod-plugins
================================

[](#getting-started-with-mod-plugins)

mod-plugins 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.

### 1. Download

[](#1-download)

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

```
composer require "panix/mod-plugins": "*"
```

### 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' => 'panix\engine\console\controllers\MigrateController',
            'migrationNamespaces' => [
                 ...
                'panix\mod\plugins\migrations'
            ],
        ],
    ],
];
```

and run the following command:

```
$ php yii migrate
```

### 3. Configure application

[](#3-configure-application)

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

```
'modules' => [
    'plugins' => [
        'class' => 'panix\mod\plugins\Module',
        'pluginsDir'=>[
            '@panix/mod/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 `@app/config/main.php` and add following:

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