-
Notifications
You must be signed in to change notification settings - Fork 31
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
Controller events #153
Controller events #153
Conversation
@@ -49,25 +47,6 @@ class AbstractRestfulController extends AbstractController | |||
protected $methodHandlerManager; | |||
|
|||
/** | |||
* If this is set to true, then controller will automatically instantiate the input filter specified in |
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.
I agree for the controller. This is definitely the way to go.
I really like it. It removes a lot of crap from the controller, make everything more flexible... that's really nice. |
Also, please update doc :D. |
Just a rough idea, maybe it's plain stupid, but for easier usage, may we automatically attach listeners in the controller (like "preInputFilter", "postInputFilter"...), with empty functions defined by default. So if someone want to have specific behaviour, they can just override the method, and do not need the hassle of manually attaching the listeners. |
Any news? :d |
@bakura10 trying to rebase it |
Nice idea, I'll do it. (Not sure if |
Looks very good to me. Let's just wait for an @Ocramius review :). |
/** | ||
* Event names | ||
*/ | ||
const EVENT_VALIDATE_PRE = 'validate.pre'; |
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.
Should probably have a mirrored validate.post
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.
That's what I told, but I think there is nearly no usage to having this event. But we may add it for completeness.
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.
So, should I replace validate.error
and validate.success
by validate.post
?
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.
I don't think so. Post could be an additional event triggered in both cases. But again, I'm really not sure about the usefulness of it... I'd say that we should not include it, and if someone really need that... we'll include it.
Any news about your new idea? :D |
Too bad this was never finished :(. |
I'm closing, #184 will bring a whole new architecture that is not backward-compatible. |
This is a try to add more flexibility to validation and hydration behaviors of ZfrRest. Not sure if I got the best approach yet tbh, so I opened this PR as a request for comments.