-
-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to create a truly extensible module #13
Comments
yii2-user (https://github.com/dektrium/yii2-user) has some good examples: |
@hashie5 i think, for this logic is better way use di :) |
@lynicidn what do you mean, better way use di? |
@hashie5 create interfaces and set classes via di container |
There are two problems Yii modules could solve:
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. |
The text was updated successfully, but these errors were encountered: