https://github.com/zofe/datagrid
https://github.com/zofe/datagrid
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zofe/datagrid
- Owner: zofe
- License: mit
- Created: 2014-10-25T20:03:30.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-10-27T22:44:35.000Z (over 11 years ago)
- Last Synced: 2025-01-15T22:28:48.800Z (over 1 year ago)
- Language: PHP
- Size: 471 KB
- Stars: 1
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Datagrid
============
DataGrid is a simple presenter widget for database queries, models, or any generic Array.
By default it produce Bootstrap 3 compatible output.
At this moment is built on [Deficient](https://github.com/zofe/deficient) (a subset of laravel components including eloquent and blade, plus [burp](https://github.com/zofe/burp) router).
The plan is to make it compatible also with laravel, as standard package.
It can
- Paginate results
- Sort results
- Display results in a HTML Table (defining each column)
- Define each column, row and cell (sorting links, formatting, etc.)
- Customize view output including pagination style
- Export results as CSV / Excel
- Let you define url-semantic for sort/pagination segments or parameters (thanks to burp)
## usage
```php
$grid = DataGrid::source(new User);
$grid->add('id','ID',true)->style('width:100px');
$grid->add('name','Name',true);
$grid->paginate(5);
```
## why not starting from laravel?
Because it can be used stand alone, and in any other framework.
It has really minimal dependencies.
## Installation
install via composer
{
"require": {
"zofe/datagrid": "dev-master"
}
}
## Setup
To configure database, views, you must reference to [Deficient](https://github.com/zofe/deficient)
This is a small how-to
- create minimum folders / configuration files
- deploy datagrid views
- deploy a front controller and a sample (optional, but suggested)
```
$ php vendor/zofe/deficient/deficient setup:folders
$ php vendor/zofe/datagrid/datagrid setup:views
$ php vendor/zofe/datagrid/datagrid setup:router
```