apy / datagrid-bundle
Symfony Datagrid Bundle
Installs: 900 528
Dependents: 13
Suggesters: 1
Security: 0
Stars: 495
Watchers: 45
Forks: 343
Open Issues: 90
Type:symfony-bundle
Requires
- php: ^7.4||^8.0
- symfony/config: ~3.0|^4.0|^5.0|^6.0
- symfony/dependency-injection: ~3.0|^4.0|^5.0|^6.0
- symfony/form: ~3.0|^4.0|^5.0|^6.0
- symfony/http-foundation: ~3.0|^4.0|^5.0|^6.0
- symfony/http-kernel: ~3.0|^4.0|^5.0|^6.0
- symfony/options-resolver: ~3.0|^4.0|^5.0|^6.0
- symfony/security-bundle: ~3.0|^4.0|^5.0|^6.0
- symfony/serializer: ~3.0|^4.0|^5.0|^6.0
- twig/twig: ^2.14 || ^3.0
Requires (Dev)
- dg/bypass-finals: ^1.3
- doctrine/doctrine-bundle: ^2.5
- doctrine/mongodb-odm: ^2.2
- doctrine/orm: ~2.10,>=2.10.0
- friendsofphp/php-cs-fixer: ^2.0
- php-coveralls/php-coveralls: ^2.0
- phpunit/phpunit: ^9.5
- rector/rector: ^0.12.13
- symfony/browser-kit: ~3.0|^4.0|^5.0|^6.0
- symfony/expression-language: ~3.0|^4.0|^5.0|^6.0
- symfony/framework-bundle: ^4.3|^5.0|^6.0
- symfony/security-bundle: ~3.0|^4.0|^5.0
- symfony/templating: ~3.0|^4.0|^5.0|^6.0
- symfony/twig-bundle: ~3.0|^4.0|^5.0
Suggests
- ext-intl: Translate the grid
- ext-mbstring: Convert your data with the right charset
- PHPExcel: Export the grid (Excel, HTML or PDF)
- doctrine/mongodb-odm: If you want to use Document as source, please require doctrine/mongodb-odm
- doctrine/orm: If you want to use Entity as source, please require doctrine/orm
- jms/translation-bundle: If you want to use translations
Provides
- ext-mongo: 1.5
This package is not auto-updated.
Last update: 2024-12-18 20:48:01 UTC
README
This Symfony Bundle allows you to create wonderful grid based on data or entities of your projet.
Features
This bundle allow you to create listing with many features that you can expect :
- Various data sources : supports Entity (ORM), Document (ODM) and Vector (Array) sources
- Data manipulation : Sortable and Filterable with many operators
- Auto-typing columns (Text, Number, Boolean, Array, DateTime, Date, ...)
- Locale support for columns and data (DateTime, Date and Number columns)
- Input, Select, checkbox and radio button filters filled with the data of the grid or an array of values
- Export (CSV, Excel, PDF, XML, JSON, HTML, ...)
- Mass actions, Row actions
- Supports mapped fields with Entity source
- Securing the columns, actions and export with security roles
- Annotations and PHP configuration
- External filters box
- Ajax loading
- Pagination (You can also use Pagerfanta)
- Grid manager for multi-grid on the same page
- Groups configuration for ORM and ODM sources
- Easy templates overriding (Twig)
- Custom columns and filters creation
- and many more
Installation, documentation
See the summary.
Screenshot
Full example with this CSS style file:
Simple example with the external filter box in english:
Same example in french:
Example of a simple grid with an ORM source
<?php namespace MyProject\MyBundle\Controller; use APY\DataGridBundle\Grid\Source\Entity; class DefaultController extends Controller { public function myGridAction() { // Creates a simple grid based on your entity (ORM) $source = new Entity('MyProjectMyBundle:MyEntity'); // Get a Grid instance $grid = $this->get('grid'); // Attach the source to the grid $grid->setSource($source); // Return the response of the grid to the template return $grid->getGridResponse('MyProjectMyBundle::myGrid.html.twig'); } }
Simple configuration of the grid in the entity
<?php namespace MyProject\MyBundle\Entity use Doctrine\ORM\Mapping as ORM; use APY\DataGridBundle\Grid\Mapping as GRID; /** * @GRID\Source(columns="id, my_datetime") */ class MyEntity { /* * @ORM\Column(type="integer") */ protected $id; /* * @ORM\Column(type="datetime") */ protected $my_datetime; }
Display the grid in a twig template
<?php <!-- MyProject\MyBundle\Resources\views\myGrid.html.twig --> {{ grid(grid) }}
And clear your cache.
Bundle history
Datagrid for Symfony inspired by Zfdatagrid and Magento Grid.
This bundle was initiated by Stanislav Turza (Sorien).
See CHANGELOG and UPGRADE 2.0