Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit10b3c7c

Browse files
committed
Other random fixes
1 parenta8a75d7 commit10b3c7c

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'veincluded 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 wanttooverride theblog "list" page to
1233-
customize the markup specifically for your application. By digging into the
1234-
``Blog`` controller of the ``AcmeBlogBundle``, you find thefollowing::
1238+
Suppose you'veinstalled 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" pagetocustomize themarkup 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)

[8]ページ先頭

©2009-2025 Movatter.jp