|
The Yaf_Plugin_Abstract classIntroductionPlugins allow for easy extensibility and customization of the framework. Plugins are classes. The actual class definition will vary based on the component -- you may need to implement this interface, but the fact remains that the plugin is itself a class. A plugin could be loaded into Yaf by using Yaf_Dispatcher::registerPlugin, after registering, All the methods which the plugin implemented according to this interface, will be called at the proper time. ExamplesExample #1 Plugin example
The above example will output something similar to: string(13) "routerStartup" string(14) "routerShutdown" string(19) "dispatchLoopStartup" string(11) "preDispatch" string(12) "postDispatch" string(20) "dispatchLoopShutdown" Class synopsisYaf_Plugin_Abstract
class Yaf_Plugin_Abstract
{
/* Methods */
public void dispatchLoopShutdown(Yaf_Request_Abstract
$request , Yaf_Response_Abstract $response )public void dispatchLoopStartup(Yaf_Request_Abstract
$request , Yaf_Response_Abstract $response )public void postDispatch(Yaf_Request_Abstract
$request , Yaf_Response_Abstract $response )public void preDispatch(Yaf_Request_Abstract
$request , Yaf_Response_Abstract $response )public void preResponse(Yaf_Request_Abstract
$request , Yaf_Response_Abstract $response )public void routerShutdown(Yaf_Request_Abstract
$request , Yaf_Response_Abstract $response )public void routerStartup(Yaf_Request_Abstract
}$request , Yaf_Response_Abstract $response )
|