lubos/table

CakePHP Table 插件帮助您通过 CakePHP 助手创建表格

安装: 81

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 2

分支: 0

开放问题: 0

类型:cakephp-plugin

0.1.0 2015-03-28 10:56 UTC

This package is auto-updated.

Last update: 2024-09-04 18:32:03 UTC


README

Build Status Latest Stable Version Total Downloads Latest Unstable Version License

A CakePHP 3.x plugin for creating Html tables

安装

composer require lubos/table

在 bootstrap.php 文件中加载插件

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

用法

在您的控制器中

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