Download the PHP package paxal/stats-table without Composer
On this page you can find all versions of the php package paxal/stats-table. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download paxal/stats-table
More information about paxal/stats-table
Files in paxal/stats-table
Package stats-table
Short Description Helper to handle stats table with multiple formatter
License MIT
Homepage https://github.com/paxal/stats-table
Informations about the package stats-table
This package is a fork of igraal/stats-table
stats-table
PHP Libary to handle statistics tables and CSV, JSON and Excel exports.
Summary
This library helps you create statistical tables given some data. You provide data, headers and what you want for the footer line, and then you can dump your table into a JSON, CSV or Excel file.
This is very useful to manipulate a lot of tables you want to see in an HTML FrontOffice and when you want to add the ability to get this data in CSV or Excel File as well.
Installation
Using composer
Using composer, just run the following to require the latest stable :
Usage
Using the class StatsTable
The class StatsTable
is the class that will hold your data. It takes one mandotary arguments, and 4 options arguments. The simpler way to create a new table is to pass the data itself and its headers (even if headers are optional).
Dumping a table
Three formats are currently supported : Excel, CSV and JSON. Thus, you can use the same table with your ajax calls or to be downloaded.
First, create your dumper, then dump your data.
Using stats table builder
To help you construct a table, you can use the StatsTableBuilder
class. It helps you combine data from multiple tables, and can create automatic calculated columns. It also helps you build aggregations (aka the footer line), with multiple possibilities : ratio, sum, average or static content.