index.html.twig 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. {% extends "base.html.twig" %}
  2. {% block title %}Products{% endblock %}
  3. {% block body %}
  4. Check out these great products:
  5. <table>
  6. <thead>
  7. <tr>
  8. <th>Id</th>
  9. <th>Name</th>
  10. <th>Price</th>
  11. <th>Raise price</th>
  12. <th>Delete</th>
  13. </tr>
  14. </thead>
  15. <tbody>
  16. {% for product in products %}
  17. {% set idAttr = {'id': product.id} %}
  18. {% set productLink = path('product_show', idAttr) %}
  19. <tr>
  20. <td><a href="{{ productLink }}">{{ product.id }}</a></td>
  21. <td><a href="{{ productLink }}">{{ product.name }}</a></td>
  22. <td>{{ "%10.2f"|format(product.price) }}</td>
  23. <td class="op"><a href="{{ path('product_raise', idAttr) }}">+</a></td>
  24. <td class="op"><a href="{{ path('product_delete', idAttr) }}">X</a></td>
  25. </tr>
  26. {% endfor %}
  27. </tbody>
  28. </table>
  29. <h3>Lists comparison</h3>
  30. <ul>
  31. <li>DQL === QueryBuilder ? {{ dql_qb ? "Y" : "N" }}</li>
  32. <li>DQL == SQL ? {{ dql_sql ? "Y" : "N" }}</li>
  33. </ul>
  34. {% endblock %}