-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
first draft cookbook before/after listeners (issue #649) #1461
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
In Symfony1, this was achieved with the preExecute and postExecute methods, most major frameworks have similar | ||
methods but there is no such thing in Symfony2. Good news is that there is a much better way to interfere our | ||
Request -> Response process with the EventListener component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the component is named EventDispatcher
Fixed and added config via xml and php :) |
@weaverryan When you have got some spare time (if any ;)), could you please also review this first draft? Can I start working on a second part about a "before" listener? |
/** | ||
* $controller passed can be either a class or a Closure. This is not usual in Symfony2 but it may happen. | ||
* If it is a class, it comes in array format | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put this comment in a normal PHP comment (/* ... */
or // ...
) but not in a PHPdoc comment (/** ... */
).
Good catches! I'll update my PR, thanks @wouterj |
first draft cookbook before/after listeners (issue #649)
* Shortened many lines slightly so that they break after the first word that crosses the 72nd character * Corrected the underlines used for the headers * Adding the map and index entries for the new cookbook
Hi Ricard! This is really great - nice work! I've made some tweaks and identified their nature in sha: 4e85d2b. The changes were really very minor - the biggest thing is to make your lines a little bit shorter. Now you can get started on the after filter - Sorry for the delay on my end :) Thanks! |
@ricardclau wrapping after the first word crossing 72 chars |
Ok, thx @stof! |
First draft for a cookbook on creating a before listener.
I'd like to receive your comments and once everything is ok, write an example also for an after listeners
This pull request is refered to issue #649: [Cookbook] Idea of article: "How to create before and after filters"
So, waiting for your comments! (And sorry for the delay on doing this)