/ZfcDatagrid

A datagrid module for ZF2 with different datasources (Doctrine2, Zend\Db, Array, ...) and output formats (jqGrid. Bootstrap, CLI, PDF, Excel,...)

Primary LanguagePHPMIT LicenseMIT

Datagrid/Datatable module for Zend Framework 2

Master Branch Build Status Coverage Status Scrutinizer Code Quality HHVM Status

Latest Stable Version Latest Unstable Version License

Total Downloads Monthly Downloads

A datagrid for ZF2 where the data input and output can be whatever you want...:-)

Over 330 tests and 1000 assertions testing the stability currently!

If you need help, please use following ressources

If you want to help out on this project:

Features

  • Datasources: Doctrine2 (QueryBuilder + Collections), Zend\Db, PhpArray, ... (others possible)
  • Output types: jqGrid, Bootstrap table, PDF, Excel, CSV, console, ... (others possible)
    • Bootstrap table with Daterange Filter need to load manually js and css
  • different column types
  • custom formatting, type based formatting (string, date, number, array...)
  • column/row styling for all or based on value comparison
  • column filtering and sorting
  • external data can be included to the dataset (like gravator or any other)
  • pagination
  • custom toolbar / view
  • ...

Installation

Install it with composer

composer require thadafinser/zfc-datagrid -o

NOTE: with 1.x we dropped support for other installation technics. Especially the ZF2 autoloading was dropped. You just need to switch to composer installation, which will make your life easier, since it comes with all needed features

Add ZfcDatagrid to your config/application.config.php

Finally create the folder: data/ZfcDatagrid

Test if it works

NOTE: This needs the additional module ZfcDatagridExamples https://github.com/ThaDafinser/ZfcDatagridExamples ####Browser####

Attention! Only PhpArray works out of the box! For Zend\Db\Sql\Select and Doctrine2 you need to install DoctrineORMModule (Doctrin2 creates the database for Zend\Db\Sql\Select)

PhpArray http://YOUR-PROJECT/zfcDatagrid/person/bootstrap

Doctrine2 http://YOUR-PROJECT/zfcDatagrid/personDoctrine2/bootstrap

Zend\Db\Sql\Select http://YOUR-PROJECT/zfcDatagrid/personZend/bootstrap

####Console#### If you just type php index.php a help for all commands will be shown

cd YOUR-PROJECT/public/
php index.php datagrid person
php index.php datagrid person --page 2
php index.php datagrid person --sortBys=age
php index.php datagrid person --sortBys=age,givenName --sortDirs=ASC,DESC

Screenshots

ScreenShot ScreenShot