Skip to content

Instantly share code, notes, and snippets.

@mehlah
Created May 29, 2011 14:18
Show Gist options
  • Save mehlah/997809 to your computer and use it in GitHub Desktop.
Save mehlah/997809 to your computer and use it in GitHub Desktop.
Li3 before and after filters
Dispatcher::applyFilter('_callable', function($self, $params, $chain) {
$chain = $chain->next($self, $params, $chain);
$chain->applyFilter('__invoke', function($self, $params, $chain) {
var_dump("before filter");
$chain = $chain->next($self, $params, $chain);
var_dump("after");
return $chain;
});
return $chain;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment