You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 3, 2022. It is now read-only.
Plugins in xFrame allow you to easily inject an object into the Dependency Injection Container. This allows you to gain access to your object so long as you can access the DIC.
Setup
Edit your config file (dev.ini, test.ini or live.ini) and add the following line under [plugin]
PLUGIN[MyPlugin]=\my\Plugin
Next you need to create your plugin class which needs to extend \xframe\plugin\Plugin and implement the init method.
namespace my;
class Plugin extends \xframe\plugin\Plugin {
public function init() {
// plugin init code here
}
}
Usage
You can then access an instance of your plugin in your code like this (assuming $dic is an instance of \xframe\util\Container\DependencyInjectionContainer.