Skip to content

Document withStringBody() vs auto-render interaction#8315

Open
dereuromark wants to merge 2 commits into
5.xfrom
5.x-withstringbody-autorender-note
Open

Document withStringBody() vs auto-render interaction#8315
dereuromark wants to merge 2 commits into
5.xfrom
5.x-withstringbody-autorender-note

Conversation

@dereuromark

Copy link
Copy Markdown
Member

Resolves the documentation gap raised in cakephp/cakephp#19511.

withStringBody() sets the response body but, by itself, has no visible effect when an action neither returns the response nor disables view rendering. In that case Controller::invokeAction() still calls render() and overwrites the body. This was undocumented and unintuitive.

Adds a warning note to the "Setting the Body" section explaining the two ways to make the string body take effect: return the response, or setResponse() plus disableAutoRender().

@PhantomWatson

Copy link
Copy Markdown
Contributor

Thanks, Mark!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants