Skip to content
/ table Public

Package for the fuelphp framework that streamlines the creation of tables with or without sorting.

Notifications You must be signed in to change notification settings

NormySan/table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

FuelPHP Table Package Readme

Package for the fuelphp framework that streamlines the creation of tables with or without sorting.


This package is still in early development.

To start using this package you need to add it to your list of always loaded files i the fuel php config.

Some example code to get you started:

$table = \Table::instance();
	
$query = Model_User::query()->order_by($table->order('username'), $table->direction())->get();

$table->header = array(
	array(
		'title'	=> 'Username',
		'table'	=> 'title',
	),
	array(
		'title'	=> 'Joined',
		'table'	=> 'created_at',
	),
);

foreach ($query as $r) {
	$data[] = array($r['title'], \Date::time_ago($r['created_at']));
}

$table->rows = $data;

$this->theme->set_partial('content', 'users/users')->set('table', $table, false);

Then in your theme partial just do a $table->render() to get a nice table :)

The value you input into $table->order() is the default table in the database that you wish the data to be orderd by if no order has been recieved trough post.

All config values are the defult ones at the moment.

About

Package for the fuelphp framework that streamlines the creation of tables with or without sorting.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages