Start working on sorting products by different columns.

This commit is contained in:
Krzysztof Płaczek
2025-01-27 12:10:15 +01:00
parent a26ad401df
commit 9b6bcd22be
5 changed files with 25 additions and 8 deletions

View File

@@ -1,15 +1,16 @@
{% extends "template.html.twig" %}
{% block content %}
{{ app.request.get('order') }}
<table class='table table-hover'>
<thead>
<tr>
<th></th>
<th></th>
<th>Name</th>
<th><a href="{{ path( app.request.get('_route') , {'order': app.request.get('order') is same as('-name')?'name':'-name'|default('-name')}) }}">Name</a></th>
<th>Categories</th>
<th></th>
<th>Price</th>
<th><a href="{{ path( app.request.get('_route') , {'order': app.request.get('order') is same as('-price')?'price':'-price'|default('-price')}) }}">Price</a></th>
<th></th>
</tr>
</thead>