domenik88 / datagrid-bundle
Symfony Datagrid Bundle
Installs: 8
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 343
Type:symfony-bundle
Requires
- php: >=7.0
- symfony/config: ~2.8|~3.0|^4.0|^5.0
- symfony/dependency-injection: ~2.8|~3.0|^4.0|^5.0
- symfony/form: ~2.8|~3.0|^4.0|^5.0
- symfony/http-foundation: ~2.8|~3.0|^4.0|^5.0
- symfony/http-kernel: ~2.8|~3.0|^4.0|^5.0
- symfony/options-resolver: ~2.8|~3.0|^4.0|^5.0
- symfony/polyfill-uuid: ^1.15
- symfony/security-core: ^4.0|^5.0
- symfony/serializer: ~2.8|~3.0|^4.0|^5.0
- twig/twig: ^2.0|^3.0
Requires (Dev)
- doctrine/mongodb-odm: ^1.1.5
- doctrine/orm: ~2.4,>=2.4.5
- friendsofphp/php-cs-fixer: ^2.0
- phpunit/phpunit: ~5.7
- satooshi/php-coveralls: ^1.0
- symfony/browser-kit: ~2.8|~3.0|^4.0|^5.0
- symfony/expression-language: ~2.8|~3.0|^4.0|^5.0
- symfony/framework-bundle: ~2.8|~3.0|^4.0|^5.0
- symfony/templating: ~2.8|~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
Provides
- ext-mongo: 1.5
- v4.0.x-dev
- 4.0.3.2
- 4.0.3.1
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.5.3
- 3.5.2
- 3.5.1
- 3.5.0
- 3.4.2
- 3.4.1
- 3.4.0
- 3.3.3
- 3.3.2
- 3.3.1
- 3.3.0
- dev-master / 3.2.x-dev
- 3.2.0
- 3.1.4
- 3.1.3
- 3.1.2
- 3.1.1
- 3.0.9
- 3.0.8
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.2.x-dev
- 2.2.16
- 2.2.1
- 2.1.16.x-dev
- 2.1.15
- 2.1.14
- 2.1.13
- v2.0
- v1.0
- dev-php-7.4-fix
- dev-LOG-148
- dev-DIC-813
- dev-mongo-embed
- dev-keep-upstream
- dev-EM-108
- dev-EX-716
- dev-KAN-266
- dev-sygnisoft
- dev-revert-806-master
- dev-nullable-filters
This package is auto-updated.
Last update: 2024-11-13 23:03:47 UTC
README
Datagrid for Symfony inspired by Zfdatagrid and Magento Grid.
This bundle was initiated by Stanislav Turza (Sorien).
See CHANGELOG and UPGRADE 2.0
Features
- Supports Entity (ORM), Document (ODM) and Vector (Array) sources
- Sortable and Filterable with operators (Comparison operators, range, starts/ends with, (not) contains, is (not) defined, regex)
- Auto-typing columns (Text, Number, Boolean, Array, DateTime, Date, ...)
- Locale support for DateTime, Date and Number columns (Decimal, Currency, Percent, Duration, Scientific, Spell out)
- 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)
- Column width and column align
- Prefix translated titles
- 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
- ...
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:
Data used in these screenshots (this is a phpMyAdmin screenshot):
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.