Extracted at 2014-06-26.
pike.ida.liu.se
[Top]
Fins
Fins.FinsController

Method Fins.FinsController()->around_filter()


Method around_filter

void around_filter(function|object filter)

Description

adds a filter to be run both before and after the event method for a request.

Parameter filter

either an object that provides a method "filter" or a function. either the function "filter" in the object, or the method itself should have the following signature:

int filter(function yield, object request, object response, mixed ... args)

at the point in the filter processing that the event should be called, yield() should be called without arguments.

a filter should return a true value if the filter was a success. otherwise, false (zero) should be returned, and the request will not be handled further. returning false indicates the filter wishes to perform a redirect or render function in order to preempt the request.

around filters may be nested, in which case the first added around filter will be called closest to the event in the controller, and subsequent filters will be called surrounding it.