Skip to content

Document RenderView method #13264

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

Merged
merged 1 commit into from
Mar 23, 2020
Merged

Document RenderView method #13264

merged 1 commit into from
Mar 23, 2020

Conversation

Midwain
Copy link
Contributor

@Midwain Midwain commented Feb 27, 2020

Hello!

Current docs doesn't mention renderView() method (Symfony 4.+).

@@ -446,6 +446,19 @@ the :class:`Twig\\Environment` class::
}
}

Rendering a Template's Content
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The ``renderView()`` method renders a template and returns its content. The content from the template can be used to create a ``Response`` object::
Copy link
Contributor

@94noni 94noni Feb 27, 2020

Choose a reason for hiding this comment

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

new line i think here
and also, new line after the its content.

'promotions' => ['...', '...'],
);

return new Response($content);
Copy link
Contributor

Choose a reason for hiding this comment

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

nice idea 👍
i would for example call a specific $response->aMethod() so that readers understand the idea behind getting the view like that and play with the $response before returning it

@javiereguiluz javiereguiluz added this to the 4.4 milestone Mar 23, 2020
@javiereguiluz javiereguiluz merged commit 7299acc into symfony:4.4 Mar 23, 2020
@javiereguiluz
Copy link
Member

@Midwain thanks for this improvement! However, while merging this we made some changes. Instead of having a dedicated section, we merged this into the existing section that talks about controllers and templates (see 1003548).

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.

4 participants