Download the PHP package warslett/table-builder without Composer
On this page you can find all versions of the php package warslett/table-builder. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download warslett/table-builder
More information about warslett/table-builder
Files in warslett/table-builder
Package table-builder
Short Description table abstraction, table building, table rendering
License MIT
Rated 5.00 based on 1 reviews
Informations about the package table-builder
Table Builder
Table builder provides table abstraction, table building and table rendering. Allowing you to configure your tables, load your data into them and then render them in a variety of ways. The package can help you implement functionality common to most table actions in CRUD applications including pagination, sorting, row actions, conditional formatting, and exporting the table to csv.
Installation
composer require warslett/table-builder
If you are using symfony there is an optional bundle that will configure the services:
composer require warslett/table-builder-bundle warslett/table-builder
Requirements
PHP 7.4, 8.0 or 8.1.
Documentation
Full documentation available here.
Overview
Table Building
Configure your tables using a variety of column types or implement your own column types. Then load data into the table using one of our data adapters or implement your own. Handle a request to apply sorting and pagination using one of our request adapters or implement your own.
Table Rendering
Modeling tables in an abstract way allows us to provide a variety of generic renderers for rendering them.
For example, with the TwigRendererExtension registered you can render the table in a twig template like this:
Or if you aren't using twig you can use the PhtmlRenderer which uses plain old php templates and has 0 third party dependencies:
Both of the above renderers are themeable and are available with a standard theme and bootstrap4 theme out the box.
You can also render tables as CSV documents:
Single Page Applications
Tables also implement JsonSerializable so they can be encoded as json in a response and consumed by a single page application.
Dependencies
Table builder has minimal core dependencies however some optional features have additional dependencies.
- CsvRenderer and related classes depends on
league/csv
- TwigRenderer and related classes depends on
twig/twig
- DoctrineORMAdapter data adapter depends on
doctrine/orm
- SymfonyHttpAdapter response adapter depends on
symfony/http-foundation
- Psr7Adapter response adapter depends on
psr/http-message
- SymfonyRoutingAdapter route generator adapter depends on
symfony/routing