Skip to content

tweaked Twig introduction #1794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions book/templating.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,18 @@ Throughout this chapter, template examples will be shown in both Twig and PHP.
not program logic. The more you use Twig, the more you'll appreciate
and benefit from this distinction. And of course, you'll be loved by
web designers everywhere.

Twig can also do things that PHP can't, such as whitespace control, sandboxing,
and the inclusion of custom functions and filters that only affect templates.
Twig contains little features that make writing templates easier and
more concise. Take the following example, which combines a loop with
a logical ``if`` statement:


Twig can also do things that PHP can't, such as whitespace control,
sandboxing, automatic and contextual output escaping, and the inclusion of
custom functions and filters that only affect templates. Twig contains
little features that make writing templates easier and more concise. Take
the following example, which combines a loop with a logical ``if``
statement:

.. code-block:: html+jinja

<ul>
{% for user in users %}
{% for user in users if user.active %}
<li>{{ user.username }}</li>
{% else %}
<li>No users found</li>
Expand Down