przewiń do treści

Symfony 2 od podstaw

Włodzimierz Gajda

<!DOCTYPE html>
<html>
  <head>
    <title>Korona Ziemi</title>
    <meta charset="UTF-8" />
    <style>
    body {
        font-family: Verdana, sans-serif;
        font-size: medium;
    }
    ...
    </style>
  </head>
<body>
<h1>Korona Ziemi</h1>

<table>
<tr>
    <th>lp.</th>
    <th>Kontynent</th>
    <th>Szczyt</th>
    <th>Wysokość<br />(m n.p.m.)</th>
</tr>
{% for gora in dane %}
    <tr>
        <td>{{ loop.index }}.</td>
        <td>{{ gora.kontynent }}</td>
        <td>{{ gora.nazwa }}</td>
        <td>{{ gora.wysokosc }}</td>
    </tr>
{% endfor %}
</table>

</body>
</html>

Listing 11.11. Zarys widoku akcji index

Rozdział 11. Instrukcje sterujące for oraz if

listing-11-11.txt

Reklama

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