abstract class Yaf_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(Yaf_Request_Abstract $request, Yaf_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(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)

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

bool
dispatchLoopStartup(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)

No description

bool
dispatchLoopShutdown(Yaf_Request_Abstract $request, Yaf_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(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)

No description

bool
postDispatch(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)

No description

bool
preResponse(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)

No description

Details

bool routerStartup(Yaf_Request_Abstract $request, Yaf_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

Yaf_Request_Abstract $request
Yaf_Response_Abstract $response

Return Value

bool true

bool routerShutdown(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)

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

Parameters

Yaf_Request_Abstract $request
Yaf_Response_Abstract $response

Return Value

bool true

bool dispatchLoopStartup(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)

No description

Parameters

Yaf_Request_Abstract $request
Yaf_Response_Abstract $response

Return Value

bool true

bool dispatchLoopShutdown(Yaf_Request_Abstract $request, Yaf_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

Yaf_Request_Abstract $request
Yaf_Response_Abstract $response

Return Value

bool true

bool preDispatch(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)

No description

Parameters

Yaf_Request_Abstract $request
Yaf_Response_Abstract $response

Return Value

bool true

bool postDispatch(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)

No description

Parameters

Yaf_Request_Abstract $request
Yaf_Response_Abstract $response

Return Value

bool true

bool preResponse(Yaf_Request_Abstract $request, Yaf_Response_Abstract $response)

No description

Parameters

Yaf_Request_Abstract $request
Yaf_Response_Abstract $response

Return Value

bool true