We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent df52e62 commit 4ae1210Copy full SHA for 4ae1210
templates.rst
@@ -446,6 +446,19 @@ the :class:`Twig\\Environment` class::
446
}
447
448
449
+Rendering a Template's Content
450
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
451
+The ``renderView()`` method renders a template and returns its content. The content from the template can be used to create a ``Response`` object::
452
+
453
+ use Symfony\Component\HttpFoundation\Response;
454
455
+ $content = $this->renderView('product/index.html.twig', [
456
+ 'category' => '...',
457
+ 'promotions' => ['...', '...'],
458
+ );
459
460
+ return new Response($content);
461
462
Rendering a Template in Emails
463
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
464
0 commit comments