Skip to content

Commit 37470d5

Browse files
committed
[book][templating] Changing to use the alternative php code block syntax in a few places
1 parent 3eee348 commit 37470d5

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

book/templating.rst

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -562,9 +562,7 @@ other heavy logic that can't be done from within a template.
562562

563563
The solution is to simply embed the result of an entire controller from your
564564
template. First, create a controller that renders a certain number of recent
565-
articles:
566-
567-
.. code-block:: php
565+
articles::
568566

569567
// src/Acme/ArticleBundle/Controller/ArticleController.php
570568

@@ -919,15 +917,11 @@ Configuring and using the ``templating`` Service
919917
The heart of the template system in Symfony2 is the templating ``Engine``.
920918
This special object is responsible for rendering templates and returning
921919
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::
925921

926922
return $this->render('AcmeArticleBundle:Article:index.html.twig');
927923

928-
is equivalent to
929-
930-
.. code-block:: php
924+
is equivalent to:
931925

932926
$engine = $this->container->get('templating');
933927
$content = $engine->render('AcmeArticleBundle:Article:index.html.twig');
@@ -1272,9 +1266,7 @@ isn't actually rendered differently based on its format.
12721266

12731267
In many cases, you may want to allow a single controller to render multiple
12741268
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::
12781270

12791271
public function indexAction()
12801272
{
@@ -1314,9 +1306,7 @@ The templating engine in Symfony is a powerful tool that can be used each time
13141306
you need to generate presentational content in HTML, XML or any other format.
13151307
And though templates are a common way to generate content in a controller,
13161308
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::
13201310

13211311
// creates a Response object whose content is the rendered template
13221312
$response = $this->render('AcmeArticleBundle:Article:index.html.twig');

0 commit comments

Comments
 (0)