-
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
Resource matcher routing (rewrite) #76
Conversation
*/ | ||
public function matchSubPath(ResourceInterface $resource, $subPath, Request $request) | ||
{ | ||
if ($resource->isCollection()) { |
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.
Is this check really needed ? It's already taken care in the BaseSubPathMatcher.
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 assume this will always be used with the BaseSubPathMatcher
Looks good otherwise :). Please, when you'll plug this to the ResourceGraphRoute, rename it to RestResourceRoute also while you're at it ;-). |
I'm taking this branch. I'm refactoring ZfrRest right now in this branch: https://github.com/zf-fr/zfr-rest/tree/voltaire I've taken your code, added some things and currently writing tests for it. So I will close yours. |
@Ocramius : regarding the filtering issue, here is how I did it: https://github.com/zf-fr/zfr-rest/blob/voltaire/src/ZfrRest/Mvc/Router/Http/Matcher/CollectionSubPathMatcher.php#L149-L158 Using events seems the only flexible way to be able to implement custom logic. What do you think? |
Supersedes #72
SubPathMatch
objectSubPathMatch
with all previous sub-path matches in itSubPathMatch