Skip to content

Commit 10b3c7c

Browse files
committed
Other random fixes
1 parent a8a75d7 commit 10b3c7c

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

book/templating.rst

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ code.
1616

1717
.. note::
1818

19-
How to render templates is covered in the :ref:`controller <controller-rendering-templates>`
20-
page of the book.
19+
How to render templates is covered in the
20+
:ref:`controller <controller-rendering-templates>` page of the book.
2121

2222
.. index::
2323
single: Templating; What is a template?
@@ -355,15 +355,15 @@ When working with template inheritance, here are some tips to keep in mind:
355355
can use the ``{{ parent() }}`` function. This is useful if you want to add
356356
to the contents of a parent block instead of completely overriding it:
357357

358-
.. code-block:: html+jinja
358+
.. code-block:: html+jinja
359359

360-
{% block sidebar %}
361-
<h3>Table of Contents</h3>
360+
{% block sidebar %}
361+
<h3>Table of Contents</h3>
362362

363-
{# ... #}
363+
{# ... #}
364364

365-
{{ parent() }}
366-
{% endblock %}
365+
{{ parent() }}
366+
{% endblock %}
367367

368368
.. index::
369369
single: Templating; Naming conventions
@@ -444,9 +444,13 @@ Template Suffix
444444
Every template name also has two extensions that specify the *format* and
445445
*engine* for that template.
446446

447-
* **Blog/index.html.twig** - HTML format, Twig engine
448-
* **Blog/index.html.php** - HTML format, PHP engine
449-
* **Blog/index.css.twig** - CSS format, Twig engine
447+
======================== ====== ======
448+
Filename Format Engine
449+
======================== ====== ======
450+
``Blog/index.html.twig`` HTML Twig
451+
``Blog/index.html.php`` HTML PHP
452+
``Blog/index.css.twig`` CSS Twig
453+
======================== ====== ======
450454

451455
By default, any Symfony template can be written in either Twig or PHP, and
452456
the last part of the extension (e.g. ``.twig`` or ``.php``) specifies which
@@ -556,7 +560,7 @@ Including this template from any other template is simple:
556560
'Article/articleDetails.html.php',
557561
array('article' => $article)
558562
) ?>
559-
<?php endforeach; ?>
563+
<?php endforeach ?>
560564
<?php $view['slots']->stop() ?>
561565

562566
The template is included using the ``{{ include() }}`` function. Notice that the
@@ -594,6 +598,10 @@ template. First, create a controller that renders a certain number of recent
594598
articles::
595599

596600
// src/AppBundle/Controller/ArticleController.php
601+
namespace AppBundle\Controller;
602+
603+
// ...
604+
597605
class ArticleController extends Controller
598606
{
599607
public function recentArticlesAction($max = 3)
@@ -1227,11 +1235,11 @@ bundles (see `KnpBundles.com`_) for a large number of different features.
12271235
Once you use a third-party bundle, you'll likely need to override and customize
12281236
one or more of its templates.
12291237

1230-
Suppose you've included the imaginary open-source ``AcmeBlogBundle`` in your
1231-
project (e.g. in the ``src/Acme/BlogBundle`` directory). And while you're
1232-
really happy with everything, you want to override the blog "list" page to
1233-
customize the markup specifically for your application. By digging into the
1234-
``Blog`` controller of the ``AcmeBlogBundle``, you find the following::
1238+
Suppose you've installed the imaginary open-source ``AcmeBlogBundle`` in your
1239+
project. And while you're really happy with everything, you want to override
1240+
the blog "list" page to customize the markup specifically for your application.
1241+
By digging into the ``Blog`` controller of the ``AcmeBlogBundle``, you find the
1242+
following::
12351243

12361244
public function indexAction()
12371245
{

0 commit comments

Comments
 (0)