Dispatcher filters (middleware)

69 views
Skip to first unread message

José Lorenzo

unread,
Apr 19, 2012, 12:57:54 AM4/19/12
to cakeph...@googlegroups.com
I recently added a new feature branch for 2.2, with the ability to add listeners to the dispatching process. Those would act as some sort of middleware that could be used for tasks varying from caching to authenticating a user. Additionally I extracted the asset and cache dispatching into filters, so they can be swapped or disabled at will.


The only thing I'm no completely sure is whether we should trigger the afterDispatch event when calling requestAction (beforeDispatch event is correctly being triggered right now). Do you think we should trigger it? I think the use cases are inexistent, given that this callback wil only be able to alter the response headers and perhaps the body, wich are not actually valid use cases for requestAction imo.

Thoughts?

mark_story

unread,
Apr 20, 2012, 9:19:39 PM4/20/12
to cakeph...@googlegroups.com
I really like the changes, I know I've mentioned that on IRC, but I'll say it again here :)  I'm really happy to have cached() and asset() as middleware.

-Mark

José Lorenzo Rodríguez

unread,
Apr 20, 2012, 9:39:38 PM4/20/12
to cakeph...@googlegroups.com
Cool, I'll start writing docs and then merge it :)
Reply all
Reply to author
Forward
0 new messages