-
Notifications
You must be signed in to change notification settings - Fork 1.7k
magento/devdocs#: Routing. Action result object. #4541
Conversation
An admin must run tests on this PR before it can be merged. |
Merge remote-tracking branch 'upstream/master' into routing-result-object # Conflicts: # guides/v2.1/extension-dev-guide/routing.md # guides/v2.3/extension-dev-guide/routing.md
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.
@atwixfirster this looks really good. I only have some minor editorial feedback.
|
||
Name | Description | ||
--- | --- | ||
`json` | Sets `Content-Type:application/json` in the header and returns a json encoded representation of an array with data. |
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.
remove ending period
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.
done
Name | Description | ||
--- | --- | ||
`json` | Sets `Content-Type:application/json` in the header and returns a json encoded representation of an array with data. | ||
`raw` | Returns the data as it's been set. Does not set a `Content-Type` of the header. |
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.
`raw` | Returns the data as it's been set. Does not set a `Content-Type` of the header. | |
`raw` | Returns the data as it's been set. Does not set a `Content-Type` in the header. |
Also, remove period from end of last sentence.
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.
done
--- | --- | ||
`json` | Sets `Content-Type:application/json` in the header and returns a json encoded representation of an array with data. | ||
`raw` | Returns the data as it's been set. Does not set a `Content-Type` of the header. | ||
`redirect` | Creates an external redirect, which the browser follows and requests a new url. |
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.
remove period from end of sentence
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.
done
`json` | Sets `Content-Type:application/json` in the header and returns a json encoded representation of an array with data. | ||
`raw` | Returns the data as it's been set. Does not set a `Content-Type` of the header. | ||
`redirect` | Creates an external redirect, which the browser follows and requests a new url. | ||
`forward` | Internally calls the execute method of another action class and does not trigger a new request from the browser. The URL stays the same. |
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.
Remove period from end of last sentence.
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.
done
`raw` | Returns the data as it's been set. Does not set a `Content-Type` of the header. | ||
`redirect` | Creates an external redirect, which the browser follows and requests a new url. | ||
`forward` | Internally calls the execute method of another action class and does not trigger a new request from the browser. The URL stays the same. | ||
`layout` | View result. A generic layout response can be used for rendering any kind of layout. So it comprises a response body from the layout elements it has and sets it to the HTTP response |
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.
`layout` | View result. A generic layout response can be used for rendering any kind of layout. So it comprises a response body from the layout elements it has and sets it to the HTTP response | |
`layout` | View result. You can use a generic layout response to render any kind of layout. The layout comprises a response body from its layout elements and sets it to the HTTP response |
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.
done
Name | Description | ||
--- | --- | ||
`json` | Sets `Content-Type:application/json` in the header and returns a json encoded representation of an array with data. | ||
`raw` | Returns the data as it's been set. Does not set a `Content-Type` of the header! |
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.
Remove ending exclamation mark
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.
{: .bs-callout .bs-callout-info } | ||
Action class should return a `result object`. | ||
|
||
## Result object |
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.
Please apply above edits to this table as well except where noted below.
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.
done
`redirect` | Creates an external redirect, which the browser follows and requests a new url. | ||
`forward` | Internally calls the execute method of another action class and does not trigger a new request from the browser. The URL stays the same. | ||
`layout` | View result. A generic layout response can be used for rendering any kind of layout. So it comprises a response body from the layout elements it has and sets it to the HTTP response | ||
`page` | View result. Encapsulates page type, page configuration and imposes certain layout handles. Triggers `layout.xml` rendering into HTML. |
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.
`page` | View result. Encapsulates page type, page configuration and imposes certain layout handles. Triggers `layout.xml` rendering into HTML. | |
`page` | View result. Encapsulates page type, page configuration, and imposes certain layout handles. `page` triggers `layout.xml` to render into HTML |
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.
done
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.
Looks good!
running tests |
Hi @atwixfirster, thank you for your contribution! |
Thanks @atwixfirster! |
Purpose of this pull request
This pull request (PR) adds information about action result objects.
Affected DevDocs pages
Links to Magento source code
Thank you!
whatsnew
Added reference documentation about the
result object
returned by theAction
class