przewiń do treści

Symfony 2 od podstaw

Włodzimierz Gajda

<!DOCTYPE html>
<html>
  <head>
    <title>Powitanie</title>
    <meta charset="UTF-8" />
  </head>
<body>

{{ komunikat }}

<hr />

{{ komunikat|raw }}

<hr />

{{ komunikat | e }}

<hr />

{{ komunikat | e('js') }}

<hr />

{% autoescape true %}
    {{ komunikat }}
{% endautoescape %}

<hr />

{% autoescape true js %}
    {{ komunikat }}
{% endautoescape %}

<hr />

{% autoescape false %}
    {{ komunikat }}
{% endautoescape %}

<hr />

{{ " ---> <strong>brak cytowania</strong> <=== " }}

<hr />

{{ " ---> cytowanie (także napisów dołączonych do zmiennej komunikat): " ~ komunikat ~ " <=== " }}

</body>
</html>

Listing 10.6. Widok powitanie.html.twig

Rozdział 10. Zmienne, wyrażenia i operatory Twig

listing-10-06.txt

Reklama

Szkolenia z Symfony 2.1
©2012 Włodzimierz Gajda
ver. 1.0.1