-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Update response chapter. #4537
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
Update response chapter. #4537
Conversation
* Document new interfaces. * Include section on common mistakes with immutable objects. Refs cakephp/cakephp#9636
|
|
||
| Sending the Response | ||
| -------------------- | ||
| Common Mistakes with Immutable Responses |
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 feel this note is way too far down the page.
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 thought it was kind of awkward at other positions in the page.
| .. meta:: | ||
| :title lang=en: Request and Response objects | ||
| :keywords lang=en: request controller,request parameters,array indexes,purpose index,response objects,domain information,request object,request data,interrogating,params,previous versions,introspection,dispatcher,rout,data structures,arrays,ip address,migration,indexes,cakephp | ||
| :keywords lang=en: request controller,request parameters,array indexes,purpose index,response objects,domain information,request object,request data,interrogating,params,previous versions,introspection,dispatcher,rout,data structures,arrays,ip address,migration,indexes,cakephp,PSR-7,immutable |
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.
PSR-7 in uppercase?
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.
Sure!
| Query string parameters can be read using the ``getQuery()`` method:: | ||
|
|
||
| // URL is /posts/index?page=1&sort=title | ||
| $this->request->getQuery('page'); |
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 would write $page = $this->request->getQuery('page');, this way it becomes even more clear. I think this is nov more important than before, as we now prefix all setter methods with a $response = .
Shall I open a separate PR after this gets merged?
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.
sure!
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.
@markstory done in #4540
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.
Thanks!
[fr] 3.4 response docs update (follow #4537)
Refs cakephp/cakephp#9636