mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-18 08:14:24 +00:00
order query for location and add pagination in list
This commit is contained in:
parent
f64409e5e6
commit
26a4577420
@ -12,6 +12,7 @@ declare(strict_types=1);
|
|||||||
namespace Chill\MainBundle\Controller;
|
namespace Chill\MainBundle\Controller;
|
||||||
|
|
||||||
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
use Chill\MainBundle\CRUD\Controller\CRUDController;
|
||||||
|
use Chill\MainBundle\Pagination\PaginatorInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
class LocationController extends CRUDController
|
class LocationController extends CRUDController
|
||||||
@ -29,4 +30,9 @@ class LocationController extends CRUDController
|
|||||||
{
|
{
|
||||||
$query->where('e.availableForUsers = true'); //TODO not working
|
$query->where('e.availableForUsers = true'); //TODO not working
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function orderQuery(string $action, $query, Request $request, PaginatorInterface $paginator)
|
||||||
|
{
|
||||||
|
return $query->addOrderBy('e.name', 'DESC');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,8 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
{{ chill_pagination(paginator) }}
|
||||||
|
|
||||||
<ul class="record_actions">
|
<ul class="record_actions">
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ path('chill_crud_main_location_new') }}" class="btn btn-create">
|
<a href="{{ path('chill_crud_main_location_new') }}" class="btn btn-create">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user