'decoupling PHP plugin system
I am using PHP to build a simple plugin system in my own MVC framework. Here is the algorithm I am using to load the plugins:
- Scan the
pluginsdirectory. - Use the wrapper pattern to wrap the plugin around the App class.
- The plugin will define its controllers and views.
Now if the plugin controller returns a view name starting with
Pluginsthen I will load the view in thepluginsdirectory. For example,Plugins.Auth.views.indexwill load the index view of Auth plugin.
Now I want a plugin to define a layout view that any plugin can use. It is an empty admin dashboard to which every plugin will add some functionality. How can I achieve this without moving the views to a single directory? I am using BladeOne as my templating engine.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
