Skip to content

LubosRemplik/CakePHP-Table

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CakePHP Table

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

A CakePHP 3.x plugin for creating Html tables

Installation

composer require lubos/table

Load plugin in bootstrap.php file

Plugin::load('Lubos/Table');

Usage

In your controller

public $helpers = [
    'Lubos/Table.Table'
];
```

In your view
```php
$cells = [
    ['cell 00', 'cell 01', 'cell02'],
    ['cell 10', 'cell 11', 'cell12'],
    ['cell 20', 'cell 21', 'cell22']
];
$this->Table->create();
$this->Table
    ->startRow(['group' => 'head', 'class' => 'header'])
    ->header('header 1')
    ->header('header 2')
    ->header('header 3')
    ->endRow();
foreach ($cells as $row) {
    $this->Table->startRow();
    foreach ($row as $cell) {
        $this->Table->cell($cell);
    }
    $this->Table->endRow();
}
echo $this->Table->display();
```

## Bugs & Features

For bugs and feature requests, please use the issues section of this repository.

If you want to help, pull requests are welcome.  
Please follow few rules:  

- Fork & clone
- Code bugfix or feature
- Follow [CakePHP coding standards](https://github.com/cakephp/cakephp-codesniffer)
- Make tests and use phpunit to pass them

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages