Stars: 484
Forks: 342
Pull Requests: 361
Issues: 723
Watchers: 47
Last Updated: 2023-09-07 07:56:43
Symfony Datagrid Bundle
License: MIT License
Languages: PHP, CSS, Twig
This Symfony Bundle allows you to create wonderful grid based on data or entities of your projet.
This bundle allow you to create listing with many features that you can expect :
See the summary.
Full example with this CSS style file:
Simple example with the external filter box in english:
Same example in french:
<?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');
}
}
<?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;
}
<?php
<!-- MyProject\MyBundle\Resources\views\myGrid.html.twig -->
{{ grid(grid) }}
And clear your cache.
Datagrid for Symfony inspired by Zfdatagrid and Magento Grid.
This bundle was initiated by Stanislav Turza (Sorien).
See CHANGELOG and UPGRADE 2.0