@@ -562,9 +562,7 @@ other heavy logic that can't be done from within a template.
562
562
563
563
The solution is to simply embed the result of an entire controller from your
564
564
template. First, create a controller that renders a certain number of recent
565
- articles:
566
-
567
- .. code-block :: php
565
+ articles::
568
566
569
567
// src/Acme/ArticleBundle/Controller/ArticleController.php
570
568
@@ -919,15 +917,11 @@ Configuring and using the ``templating`` Service
919
917
The heart of the template system in Symfony2 is the templating ``Engine ``.
920
918
This special object is responsible for rendering templates and returning
921
919
their content. When you render a template in a controller, for example,
922
- you're actually using the templating engine service. For example:
923
-
924
- .. code-block :: php
920
+ you're actually using the templating engine service. For example::
925
921
926
922
return $this->render('AcmeArticleBundle:Article:index.html.twig');
927
923
928
- is equivalent to
929
-
930
- .. code-block :: php
924
+ is equivalent to:
931
925
932
926
$engine = $this->container->get('templating');
933
927
$content = $engine->render('AcmeArticleBundle:Article: index.html.twig');
@@ -1272,9 +1266,7 @@ isn't actually rendered differently based on its format.
1272
1266
1273
1267
In many cases, you may want to allow a single controller to render multiple
1274
1268
different formats based on the "request format". For that reason, a common
1275
- pattern is to do the following:
1276
-
1277
- .. code-block :: php
1269
+ pattern is to do the following::
1278
1270
1279
1271
public function indexAction()
1280
1272
{
@@ -1314,9 +1306,7 @@ The templating engine in Symfony is a powerful tool that can be used each time
1314
1306
you need to generate presentational content in HTML, XML or any other format.
1315
1307
And though templates are a common way to generate content in a controller,
1316
1308
their use is not mandatory. The ``Response `` object returned by a controller
1317
- can be created with our without the use of a template:
1318
-
1319
- .. code-block :: php
1309
+ can be created with our without the use of a template::
1320
1310
1321
1311
// creates a Response object whose content is the rendered template
1322
1312
$response = $this->render('AcmeArticleBundle:Article:index.html.twig');
0 commit comments