2017 © Pedro PelĂĄez
 

library htmltable

HTMLtable to create and show tables with pagination

image

rcus/htmltable

HTMLtable to create and show tables with pagination

  • Tuesday, December 23, 2014
  • by rcus
  • Repository
  • 0 Watchers
  • 0 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Build Status Scrutinizer Code Quality Code Coverage, (*1)

HTMLtable

Use HTMLtable to create and show tables with pagination., (*2)

Made for Anax-MVC in the course phpmvc at BTH., (*3)

Use with Anax

Install

Add rcus/htmltable to your composer.json file with require., (*4)

"minimum-stability": "dev",
"require": {
    ...
    "rcus/htmltable": "dev-master"
}

Run composer install --no-dev or composer update --no-dev to get rcus/htmltable. rcus/htmltable require mos/cdatabase and will install it for you. While mos/cdatabase is a dev version you need to set "minimum-stability": "dev"., (*5)

Tip: If you would like to test HTMLtable, copy htmltable.php from /vendor/rcus/htmltable/webroot to /webroot and point your browser to that file., (*6)

Usage

First we have to create a table object in your pagecontroller., (*7)

// Create a table object
$table = new rcus\HTMLTable\CHTMLTable(require ANAX_APP_PATH . 'config/database_sqlite.php');

You maybe have to edit the path and filename for your configuration of the database. If you do not have any config-file, copy from vendor/rcus/htmltable/webroot and edit (if needed). Read more about this at dbwebb., (*8)

If you would like to add some testdata to the table, add this:, (*9)

// Create tabledata
require ANAX_INSTALL_PATH . 'vendor/rcus/htmltable/webroot/includeCreateTableData.php';

Set up your table with the testdata we created above., (*10)

// Set options for table
$table->setTableOptions('test',
    array(
        'ID'         => 'id',
        'Förnamn'    => 'firstname',
        'Efternamn'  => 'surname',
        'Födelsedag' => 'birthdate'
    ));

'test' refers to the table name in the database. Then add the columns you want to include in your table in the array, where $key will be the column's title and $value is the column's name in the database., (*11)

Finally, create the table. The fun part..., (*12)

// Get the HTMLtable
$table->getHTML();

Well, it might not be that fun. But this line convert your table in the database to a HTML table., (*13)

About

Requirements

To-do list

  • Specify which columns to order
  • Make values clickable
  • Make table cacheable
  • Add some style (I know, it doesn't look that nice. But that's not a problem with your CSS-skills)

Author

Marcus Törnroth (m@rcus.se), (*14)

License

HTMLTable is licensed under the MIT License - see the LICENSE.txt file for details, (*15)

The Versions

23/12 2014

dev-master

9999999-dev http://github.com/rcus/htmltable

HTMLtable to create and show tables with pagination

  Sources   Download

MIT

The Requires

 

by Marcus Törnroth

table pagination

05/12 2014

v0.2.1

0.2.1.0 http://github.com/rcus/htmltable

HTMLtable to create and show tables with pagination

  Sources   Download

MIT

The Requires

 

by Marcus Törnroth

table pagination

25/11 2014

v0.2

0.2.0.0 http://github.com/rcus/htmltable

HTMLtable to create and show tables with pagination

  Sources   Download

MIT

The Requires

 

by Marcus Törnroth

table pagination

17/11 2014

v0.1

0.1.0.0 http://github.com/rcus/htmltable

HTMLtable to create and show tables with pagination

  Sources   Download

MIT

The Requires

 

by Marcus Törnroth

table pagination