abstract class Plugin_Abstract (View source)

Plugins 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 registered, All the methods which the plugin implemented according to this interface, will be called at the proper time.

Methods

bool
routerStartup(Request_Abstract $request, Response_Abstract $response)

This is the earliest hook in Yaf plugin hook system, if a custom plugin implement this method, then it will be called before routing a request.

bool
routerShutdown(Request_Abstract $request, Response_Abstract $response)

This hook will be trigged after the route process finished, this hook is usually used for login check.

bool
dispatchLoopStartup(Request_Abstract $request, Response_Abstract $response)

No description

bool
dispatchLoopShutdown(Request_Abstract $request, Response_Abstract $response)

This is the latest hook in Yaf plugin hook system, if a custom plugin implement this method, then it will be called after the dispatch loop finished.

bool
preDispatch(Request_Abstract $request, Response_Abstract $response)

No description

bool
postDispatch(Request_Abstract $request, Response_Abstract $response)

No description

bool
preResponse(Request_Abstract $request, Response_Abstract $response)

No description

Details

bool routerStartup(Request_Abstract $request, Response_Abstract $response)

This is the earliest hook in Yaf plugin hook system, if a custom plugin implement this method, then it will be called before routing a request.

Parameters

Request_Abstract $request
Response_Abstract $response

Return Value

bool true

bool routerShutdown(Request_Abstract $request, Response_Abstract $response)

This hook will be trigged after the route process finished, this hook is usually used for login check.

Parameters

Request_Abstract $request
Response_Abstract $response

Return Value

bool true

bool dispatchLoopStartup(Request_Abstract $request, Response_Abstract $response)

No description

Parameters

Request_Abstract $request
Response_Abstract $response

Return Value

bool true

bool dispatchLoopShutdown(Request_Abstract $request, Response_Abstract $response)

This is the latest hook in Yaf plugin hook system, if a custom plugin implement this method, then it will be called after the dispatch loop finished.

Parameters

Request_Abstract $request
Response_Abstract $response

Return Value

bool true

bool preDispatch(Request_Abstract $request, Response_Abstract $response)

No description

Parameters

Request_Abstract $request
Response_Abstract $response

Return Value

bool true

bool postDispatch(Request_Abstract $request, Response_Abstract $response)

No description

Parameters

Request_Abstract $request
Response_Abstract $response

Return Value

bool true

bool preResponse(Request_Abstract $request, Response_Abstract $response)

No description

Parameters

Request_Abstract $request
Response_Abstract $response

Return Value

bool true