APYDataGridBundle

Symfony Datagrid Bundle

Github星跟蹤圖

Datagrid for Symfony inspired by Zfdatagrid and Magento Grid.
This bundle was initiated by Stanislav Turza (Sorien).

Build Status
Coverage Status
Stories in Ready
Gitter

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:

test

Simple example with the external filter box in english:

test

Same example in french:

test

Data used in these screenshots (this is a phpMyAdmin screenshot):

test

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.

主要指標

概覽
名稱與所有者APY/APYDataGridBundle
主編程語言PHP
編程語言PHP (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2011-05-17 12:28:58
推送於2025-02-06 16:45:58
最后一次提交2025-02-06 17:15:28
發布數24
最新版本名稱7.0.0 (發布於 2025-02-06 17:16:45)
第一版名稱v1.0 (發布於 2012-06-22 01:20:15)
用户参与
星數495
關注者數42
派生數341
提交數1.4k
已啟用問題?
問題數728
打開的問題數76
拉請求數293
打開的拉請求數10
關閉的拉請求數92
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?