21.10.2015 Views

1-33

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Symfony2 – Franz Jordán 2011<br />

<br />

<br />

{{ post.title }}<br />

<br />

<br />

{% endfor %}<br />

<br />

{% endblock %}<br />

The corresponding layout.html.twig template is also easier to write:<br />

{# app/Resources/views/layout.html.twig #}<br />

<br />

<br />

{% block title %}Default title{% endblock %}<br />

<br />

<br />

{% block body %}{% endblock %}<br />

<br />

<br />

Twig is well-supported in Symfony2. And while PHP templates will always be supported in<br />

Symfony2, we'll continue to discuss the many advantages of Twig. For more information, see<br />

the templating chapter.<br />

Learn more from the Cookbook<br />

How to use PHP instead of Twig for Templates<br />

How to define Controllers as Services<br />

Installing and Configuring Symfony<br />

29

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!