Download the PHP package wedevelopnl/ux-table without Composer
On this page you can find all versions of the php package wedevelopnl/ux-table. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wedevelopnl/ux-table
More information about wedevelopnl/ux-table
Files in wedevelopnl/ux-table
Package ux-table
Short Description Symfony UX Table with search, filter and sorting options.
License MIT
Informations about the package ux-table
WeDevelop UX Table
EXPERIMENTAL: This package is still under development, everything is subject to change.
Description
UX Table is a Data Table designed to work well with Symfony UX Turbo and Stimulus (part of Symfony Encore). This package aims to utilize the beautiful simplicity of Hypermedia-Driven Application (HDA) architecture.
This package contains building blocks to create a completely flexible data table. More specifically, it helps generate forms (with hidden inputs) and links that retain the state of your UX table.
The pros of this method:
- Full control over your template
- No javascript (even works with javascript disabled)
- No serialization
Prerequisites
Symfony UX Turbo
Make sure Symfony UX Turbo is installed and setup. We heavily rely on this functionality to make this a nice user experience.
Install
With Symfony Flex
You should be able to just get started.
Without Symfony Flex
npm i -D vendor/wedevelopnl/ux-table/assets-
Add to
bundles.php - Add to
assets/controllers.json
Getting started
Create a form
First we create a new Form which extends WeDevelop\UXTable\Table\AbstractTable
This is a basic data table which adds a filter for the name field.
Create a controller action
Template
There's a few important things here.
This makes it so that when we're navigating within a Turbo Frame, we make sure not to render the entire layout, for performance's sake.
We use the UX Table Twig Component , it's a very slim component that makes sure everything is wrapped in a stimulus controller, turbo frame and form tags
Here we utilize the SortLink Twig Component to generate a link that retains the query parameters that contain the state of the UX Table.
Here we utilize the Filter Twig Component to show the form field for that filter.
Data Providers
By default, this package relies on the DoctrineORMProvider provided to automatically query the database.
If you want to use custom hydration you can configure a hydrator for the DoctrineORMProvider:
You can also create your own DataProvider by creating a class that implements
the WeDevelop\UXTable\DataProvider\DataProviderInterface.
Here we also define a status option which can be passes to the process function:
All versions of ux-table with dependencies
symfony/dependency-injection Version ^6.4 || ^7.0 || ^8.0
symfony/form Version ^6.4 || ^7.0 || ^8.0
symfony/routing Version ^6.4 || ^7.0 || ^8.0
symfony/ux-twig-component Version >2
twig/twig Version >2
knplabs/knp-paginator-bundle Version >5.4