File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ The content-type of the response can be set explicitly in a PHP route handler.
320320
321321The echoed content of the PHP file is taken.
322322
323- If the HTML content contains a ` html ` element or a ` Doctype ` , the HTML content is taken as is.
323+ If the HTML content contains an ` html ` element or a ` Doctype ` , the HTML content is output as it is.
324324
325325Otherwise the Twig layout is determined via the layout comment ` <!-- layout: my-layout.html.twig --> ` in the HTML content.
326326The page title is determined by the H1-H3 headings in the HTML content.
@@ -330,11 +330,12 @@ The layout is applied and output together with the page title and the HTML conte
330330
331331If you want finer control over the HTTP response, you can return a string, an array or a ` Symfony\Component\HttpFoundation\Response ` object.
332332
333- If the return value is a string, it is output as is with a ` text/html ` content-type .
333+ If the return value is a string, it is output as HTML with the content type ` text/html ` .
334334
335- If return value is an array, it is JSON encoded and output with a ` application/json ` content-type .
335+ If the return value is an array, it is JSON encoded and output with the content-type ` application/json ` .
336336
337- If return value is a ` Response ` object, it is output as is.
337+ If the return value is a ` Symfony\Component\HttpFoundation\Response ` object, it is output unchanged together with the underlying content type.
338+ There are several response subclasses to help you return JSON, redirect, stream file downloads and more.
338339
339340### Events
340341
You can’t perform that action at this time.
0 commit comments