Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/loveorigami/yii2-plugins-system
Yii2 plugins system module with event manager and https://github.com/loveorigami/yii2-shortcodes-pack
https://github.com/loveorigami/yii2-plugins-system
plugins shortcode shortcodes yii2 yii2-plugins
Last synced: 2 days ago
JSON representation
Yii2 plugins system module with event manager and https://github.com/loveorigami/yii2-shortcodes-pack
- Host: GitHub
- URL: https://github.com/loveorigami/yii2-plugins-system
- Owner: loveorigami
- License: mit
- Created: 2015-08-02T15:39:20.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-12T11:10:42.000Z (almost 6 years ago)
- Last Synced: 2024-04-26T08:22:29.934Z (9 months ago)
- Topics: plugins, shortcode, shortcodes, yii2, yii2-plugins
- Language: PHP
- Homepage:
- Size: 830 KB
- Stars: 115
- Watchers: 20
- Forks: 23
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-yii2 - yii2-plugins-system
README
# Getting started with Yii2-plugins-system
[![Latest Stable Version](https://poser.pugx.org/loveorigami/yii2-plugins-system/v/stable)](https://packagist.org/packages/loveorigami/yii2-plugins-system)
[![Total Downloads](https://poser.pugx.org/loveorigami/yii2-plugins-system/downloads)](https://packagist.org/packages/loveorigami/yii2-plugins-system)
[![License](https://poser.pugx.org/loveorigami/yii2-plugins-system/license)](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)
### 1. Download
Yii2-plugins-system can be installed using composer. Run following command to download and
install Yii2-plugins-system:```bash
composer require "loveorigami/yii2-plugins-system": ">=3.*"
```### 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)```php
return [
'controllerMap' => [
'migrate' => [
'class' => 'yii\console\controllers\MigrateController',
'migrationNamespaces' => [
...
'lo\plugins\migrations'
],
],
],
];
```and run the following command:
```php
$ php yii migrate
```### 3. Configure application
Let's start with defining module in `@backend/config/main.php`:
```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:
```php
...
'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' => [
']*>' => '<\/pre>',
//'