{"id":13411079,"url":"https://github.com/loveorigami/yii2-plugins-system","last_synced_at":"2025-07-21T05:05:49.332Z","repository":{"id":35802264,"uuid":"40084051","full_name":"loveorigami/yii2-plugins-system","owner":"loveorigami","description":"Yii2 plugins system module with event manager and https://github.com/loveorigami/yii2-shortcodes-pack","archived":false,"fork":false,"pushed_at":"2019-03-12T11:10:42.000Z","size":850,"stargazers_count":115,"open_issues_count":0,"forks_count":23,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-06-09T07:27:53.924Z","etag":null,"topics":["plugins","shortcode","shortcodes","yii2","yii2-plugins"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/loveorigami.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-02T15:39:20.000Z","updated_at":"2025-02-25T01:45:19.000Z","dependencies_parsed_at":"2022-09-08T18:31:25.133Z","dependency_job_id":null,"html_url":"https://github.com/loveorigami/yii2-plugins-system","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/loveorigami/yii2-plugins-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loveorigami%2Fyii2-plugins-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loveorigami%2Fyii2-plugins-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loveorigami%2Fyii2-plugins-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loveorigami%2Fyii2-plugins-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loveorigami","download_url":"https://codeload.github.com/loveorigami/yii2-plugins-system/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loveorigami%2Fyii2-plugins-system/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266242072,"owners_count":23898102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["plugins","shortcode","shortcodes","yii2","yii2-plugins"],"created_at":"2024-07-30T20:01:11.259Z","updated_at":"2025-07-21T05:05:49.310Z","avatar_url":"https://github.com/loveorigami.png","language":"PHP","funding_links":[],"categories":["Module 模块","Extensions"],"sub_categories":["Content"],"readme":"# Getting started with Yii2-plugins-system\n[![Latest Stable Version](https://poser.pugx.org/loveorigami/yii2-plugins-system/v/stable)](https://packagist.org/packages/loveorigami/yii2-plugins-system) \n[![Total Downloads](https://poser.pugx.org/loveorigami/yii2-plugins-system/downloads)](https://packagist.org/packages/loveorigami/yii2-plugins-system)\n[![License](https://poser.pugx.org/loveorigami/yii2-plugins-system/license)](https://packagist.org/packages/loveorigami/yii2-plugins-system)\n\nYii2-plugins-system is designed to work out of the box. It means that installation requires\nminimal steps. Only one configuration step should be taken and you are ready to\nhave plugin system on your Yii2 website.\n\n![\"Plugins\"](docs/img/tab_plugins.jpg)\n\n### 1. Download\n\nYii2-plugins-system can be installed using composer. Run following command to download and\ninstall Yii2-plugins-system:\n\n```bash\ncomposer require \"loveorigami/yii2-plugins-system\": \"\u003e=3.*\"\n```\n\n### 2. Update database schema\n\nThe last thing you need to do is updating your database schema by applying the\nmigrations. Make sure that you have properly configured `db` application component,\nadd in our console config namespace migration - [more here](http://www.yiiframework.com/doc-2.0/guide-db-migrations.html#namespaced-migrations)\n\n```php\nreturn [\n    'controllerMap' =\u003e [\n        'migrate' =\u003e [\n            'class' =\u003e 'yii\\console\\controllers\\MigrateController',\n            'migrationNamespaces' =\u003e [\n                 ...\n                'lo\\plugins\\migrations'\n            ],\n        ],\n    ],\n];\n```\n\nand run the following command:\n\n```php\n$ php yii migrate\n```\n\n### 3. Configure application\n\nLet's start with defining module in `@backend/config/main.php`:\n\n```php\n'modules' =\u003e [\n    'plugins' =\u003e [\n        'class' =\u003e 'lo\\plugins\\Module',\n        'pluginsDir'=\u003e[\n            '@lo/plugins/core', // default dir with core plugins\n            // '@common/plugins', // dir with our plugins\n        ]\n    ],\n],\n```\nThat's all, now you have module installed and configured in advanced template.\n\nNext, open `@frontend/config/main.php` and add following:\n\n```php\n...\n'bootstrap' =\u003e ['log', 'plugins'],\n...\n'components' =\u003e [\n    'plugins' =\u003e [\n        'class' =\u003e lo\\plugins\\components\\PluginsManager::class,\n        'appId' =\u003e 1 // lo\\plugins\\BasePlugin::APP_FRONTEND,\n        // by default\n        'enablePlugins' =\u003e true,\n        'shortcodesParse' =\u003e true,\n        'shortcodesIgnoreBlocks' =\u003e [\n            '\u003cpre[^\u003e]*\u003e' =\u003e '\u003c\\/pre\u003e',\n            //'\u003cdiv class=\"content[^\u003e]*\u003e' =\u003e '\u003c\\/div\u003e',\n        ]\n    ],\n    'view' =\u003e [\n        'class' =\u003e lo\\plugins\\components\\View::class,\n    ]\n    ...\n]\n```\n\nAlso do the same thing with \n* `@backend/config/main.php`\n* `@console/config/main.php`\n* `@api/config/main.php`\n* our modules \n* etc...\n\n```php\n...\n'bootstrap' =\u003e ['log', 'plugins'],\n...\n'components' =\u003e [\n    'plugins' =\u003e [\n        'class' =\u003e lo\\plugins\\components\\PluginsManager::class,\n        'appId' =\u003e 2 // lo\\plugins\\BasePlugin::APP_BACKEND or our appId\n    ],\n    'view' =\u003e [\n        'class' =\u003e lo\\plugins\\components\\View::class,\n    ]\n    ...\n]\n```\n\n## Base AppId ```lo\\plugins\\BasePlugin::```\n* const APP_FRONTEND = 1;\n* const APP_BACKEND = 2;\n* const APP_COMMON = 3;\n* const APP_API = 4;\n* const APP_CONSOLE = 5;\n\n## Shortcodes\n* [Yii2-shortcodes-pack](https://github.com/loveorigami/yii2-shortcodes-pack)\n\n## Core plugins (examples)\n\n* [External links](src/core/extralinks)\n* [Http Authentication](src/core/httpauth)\n* [Hello world!](src/core/helloworld)\n\n## Your plugins\n\n* [Create](docs/create_plugin.md)\n* [Install](docs/install_plugin.md)\n\n## Contributing to this project\n\nAnyone and everyone is welcome to contribute. Please take a moment to\nreview the [guidelines for contributing](CONTRIBUTING.md).\n\n## License\n\nYii2-plugins-system is released under the MIT License. See the bundled [LICENSE.md](LICENSE.md)\nfor details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floveorigami%2Fyii2-plugins-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floveorigami%2Fyii2-plugins-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floveorigami%2Fyii2-plugins-system/lists"}