Download the PHP package lososoid/data-grid-bundle without Composer
On this page you can find all versions of the php package lososoid/data-grid-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package data-grid-bundle
KitpagesDataGridBundle
This Symfony2 Bundle is a simple datagrid bundle. It aims to be easy to use and extensible.
Warning version 2
Version 2 is here. You can switch to branch 1.x (or tags 1.x) if you want to stay on legacy version. There are BC Breaks between version 1 and version 2.
Actual state
- v1.x is stable, production ready
- v2.x is stable and production ready
- v2.5.x is following version 2.5.x of doctrine
- v2.4.x is following version 2.4.x of doctrine
Features
- Display a Data Grid from a Doctrine 2 Query Builder
- Automatic filter
- Sorting on columns
- Easy to configure
- Easy to extend
- Documented (in this readme for basics and in Resources/doc for advanced topics)
- Paginator can be used as a standalone component
- Change of DataGrid behaviour with events
- Change of DataGrid presentation with twig embeds
System Requirement
- jQuery has to be present on your pages
- version 1.8+ of twig is mandatory (use of twig embeds)
Documentation
The documentation is in this README and in Resources/doc
- Installation and simple user's guide : In this README
- Grid Extended Use
- Standalone Paginator
- Events for extended use case
Installation
You need to add the following lines in your deps :
Add KitpagesChainBundle in your composer.json
Now tell composer to download the bundle by running the step:
AppKernel.php
Configuration in config.yml
These values are default values. You can skip the configuration if it is ok for you.
Note you can use the followin configuration in order to user Bootstrap 3 :
Simple Usage example
In the controller
Twig associated
In your twig you just have to put this code to display the grid you configured.
{% embed kitpages_data_grid.grid.default_twig with {'grid': grid} %}
{% endembed %}
More advanced usage
In the controller
same controller than before
Twig associated
If you want to add a column on the right of the table, you can put this code in your twig.
{% embed kitpages_data_grid.grid.default_twig with {'grid': grid} %}
{% block kit_grid_thead_column %}
<th>Action</th>
{% endblock %}
{% block kit_grid_tbody_column %}
<td><a href="{{ path ("my_route", {"id": item.id}) }}">Edit</a></td>
{% endblock %}
{% endembed %}
More advanced usage
In the controller
Twig associated
same Twig than before
Field "as"
For request like
$queryBuilder->select("item, item.id * 3 as foo");
You can display the foo field with
$gridConfig->addField("item.id");
$gridConfig->addField("foo");
Events
You can modify the way this bundle works by listening events and modify some objects injected in the $event.
see the event documentation in Resources/doc/30-Events.md
Reference guide
Add a field in the gridConfig
when you add a field, you can set these parameters :
What can you personalize in your twig template
With the embed system of twig 1.8 and more, you can override some parts of the default rendering (see example in the "More advanced usage" paragraph).
You can consult the base twig template here to see what you can personalize. https://github.com/kitpages/KitpagesDataGridBundle/blob/master/Resources/views/Grid/grid.html.twig
All versions of data-grid-bundle with dependencies
symfony/framework-bundle Version *
doctrine/orm Version *
doctrine/doctrine-bundle Version *
twig/twig Version *
symfony/twig-bundle Version *