PHPackages                             digitalwand/yii2-modular-app - 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. [Framework](/categories/framework)
4. /
5. digitalwand/yii2-modular-app

ActiveYii2-extension[Framework](/categories/framework)

digitalwand/yii2-modular-app
============================

API to build modular Yii2 applications

1.0(6y ago)08MITPHPPHP &gt;=7.3

Since Nov 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/DigitalWand/yii2-modular-app)[ Packagist](https://packagist.org/packages/digitalwand/yii2-modular-app)[ RSS](/packages/digitalwand-yii2-modular-app/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (2)Used By (0)

Yii2 modular application
========================

[](#yii2-modular-application)

API to build modular Yii2 applications.

Abstract
--------

[](#abstract)

Yii2 have flexible module system. But if we have project, consists of many modules, we would face this list of problems:

- Every time write boilerplate code to make module controllers work properly and to enable module in config file
- Migrations are project-wide, and you need a bit more code to store migrations into module's code. More boilerplate again.
- Mail templates are project-wide, we also need additional code...
- Module autoloading works only when calling module's controller. But if you module provide only API? We need to control module loading manually.
- Everything mess is possible inside Yii2 module. You have not any strict patterns, how to organise structure. So, modules from one project might look very different without an evil teamlead

This extension's purpose is to avoid that annoying rakes and make development of modular project more fast and code - more clean and well-structured

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist digitalwand/yii2-modular-app "*"

```

or add

```
"digitalwand/yii2-modular-app": "*"

```

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

Now you should use module's CoreConsoleApplication and CoreWebApplication instead Yii2 Modify you web/index.php to look like this:

```
