Skip to content

Conversation

@markstory
Copy link
Member

  • Document new interfaces.
  • Include section on common mistakes with immutable objects.

Refs cakephp/cakephp#9636

* Document new interfaces.
* Include section on common mistakes with immutable objects.

Refs cakephp/cakephp#9636

Sending the Response
--------------------
Common Mistakes with Immutable Responses
Copy link
Member

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.

Copy link
Member Author

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PSR-7 in uppercase?

Copy link
Member Author

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');
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@markstory done in #4540

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@markstory markstory merged commit 271136a into 3.4 Dec 20, 2016
@markstory markstory deleted the response-docs branch December 20, 2016 22:10
antograssiot added a commit that referenced this pull request Jan 10, 2017
[fr] 3.4 response docs update (follow #4537)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants