Class Grid
Creates a grid view of a sql statement
Usage
$dbg = new \Module\DB\Grid('users', 'SELECT * FROM users'); $dbg->exclude(array( 'user_id', 'password' )); $dbg->mapFields(array( 'name' => 'user_id' )); $dbg->sortable(array( 'name', 'date' )); $dbg->show();
Changelog
Version 1.2
- Added namespacing
Version 1.1
- Added the date section to documentation
Dependencies
- class.db.php
- class.hooks.php
Namespace: Module\DB
License: http://opensource.org/licenses/MIT
Author: Jaime A. Rodriguez hi.i.am.jaime@gmail.com
Version: 1.2
Date: August 13, 2014
Located at rid/class.dbgrid.php
License: http://opensource.org/licenses/MIT
Author: Jaime A. Rodriguez hi.i.am.jaime@gmail.com
Version: 1.2
Date: August 13, 2014
Located at rid/class.dbgrid.php
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
private
boolean
|
|
public
|
|
public
integer
|
|
public
|
protected
|
$db
DB The DB object |
|
protected
|
$name
string The name of our grid |
|
protected
|
$sql
string The SQL to run to make the grid |
|
protected
string
|
$sortBy
string The column to sort by |
#
''
|
protected
boolean
|
$asc
string Ascending? or Descending? |
#
true
|
public
integer
|
$maxRecords
int How many records per page? |
#
10
|
public
integer
|
$page
int Which page are we on? |
#
1
|
public
|
$meta
object The meta data for the fields |
|
protected
|
$canSortby
array string fields that are sortable. Used when rendering column header links |
|
protected
|
$excluded
array string Which fields to exclude from the table |
|
protected
|
$map
array associative An array of fields => id that gets passed to the hooks |
|
protected
|
$querystring
string Querystring to pass into the sorting links in the th |