yii2-cookbook icon indicating copy to clipboard operation
yii2-cookbook copied to clipboard

How to create a truly extensible module

Open samdark opened this issue 11 years ago • 10 comments

  • Comments module.
  • Interface for user.

samdark avatar Jun 27 '14 10:06 samdark

yii2-user (https://github.com/dektrium/yii2-user) has some good examples: http://yii2-user.readthedocs.org/en/latest/basics/overriding-models.html

rubenheymans avatar Jun 27 '14 11:06 rubenheymans

@hashie5 i think, for this logic is better way use di :)

lynicidn avatar Jun 27 '14 20:06 lynicidn

@lynicidn what do you mean, better way use di?

rubenheymans avatar Jun 28 '14 17:06 rubenheymans

@hashie5 create interfaces and set classes via di container

lynicidn avatar Jun 28 '14 18:06 lynicidn

https://github.com/artkost/yii2-qa/issues/24

samdark avatar Mar 26 '15 22:03 samdark

https://toster.ru/q/190201?e=1884467

samdark avatar Apr 20 '15 22:04 samdark

There are two problems Yii modules could solve:

  1. Grouping alike functionality.
  2. Isolating functionality for future reuse within different projects.

When Yii core team developed modules the purpose was always about both. When it went into the wild, community started using modules for grouping only more often than for isolation which is understandable since proper isolation is hard to achieve. If the module is isolated it never uses anything from outside of it. If it needs something, it provides an interface to be implemented by the one using the module. Same applies the other way around i.e. external usage of the module internals is strictly prohibited except what’s provided by module’s interfaces.

samdark avatar Jun 15 '16 11:06 samdark

http://www.yiiframework.com/forum/index.php/topic/71278-modules-in-yii/

samdark avatar Jun 20 '16 09:06 samdark

http://haru-atari.com/blog/14/flexible-module-architecture-on-yii2-path-1-collecting-of-modules-routing-and-events

samdark avatar Jun 20 '16 09:06 samdark

http://devconf.ru/ru/offers/offer/113

samdark avatar Jun 20 '16 09:06 samdark