-
Notifications
You must be signed in to change notification settings - Fork 658
Conversation
This builds it before dispatching instead.
Boom, simplifcation.
@WP-API/amigos #reviewmerge |
Also changes get_param to use POST (if relevant), then GET, then the URL parameters. This mirrors the previous behaviour from v1.
protected $route; | ||
|
||
/** | ||
* Attributes (options) for the route that was matched |
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.
What are some example options?
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.
Added documentation; this is the array used in the registration.
Generally, I like this idea a lot. The conservative side of me wonders if it's too magical for core. @nacin @markjaquith opinions? To summarize, the default argument to our new |
* | ||
* @var string | ||
*/ | ||
protected $method = ''; |
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 this default to GET
?
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 think it's better to not default here so that it's evident if it hasn't been set. I'd even be happy with defaulting to null
.
Updated as per review.
The ArrayAccess is a bit magical, but I don't think it's any worse than things like I'm going to go ahead and merge this, as I think we're OK with the idea as a whole, and we can PR any other changes we want here. |
This is essentially a bag of everything relating to the request.
Fixes #552.