8ctopus/array-to-table
最新稳定版本:0.2.1
Composer 安装命令:
composer require 8ctopus/array-to-table
包简介
php array to bootstrap 5 table
关键字:
README 文档
README
Convert php array to Twitter bootstrap 5 table.
install and demo
composer require 8ctopus/array-to-table
<?php declare(strict_types=1); use Oct8pus\ArrayToTable\ArrayToTable; require_once __DIR__ . '/vendor/autoload.php'; $data = [ [ 'id' => 1, 'firstName' => 'John', 'transactionId' => 'A1-2019', 'refunded' => 0, 'purchaseDate' => '2019-12-01 00:00:00', 'expiryDate' => '2020-12-01 00:00:00', ], [ 'id' => 2, 'firstName' => 'Mark', 'transactionId' => 'A1-2020', 'refunded' => 0, 'purchaseDate' => '2020-12-05 00:00:00', 'expiryDate' => '2021-12-05 00:00:00', ], [ 'id' => 3, 'firstName' => 'Joe', 'transactionId' => 'A1-2022', 'refunded' => 1, 'purchaseDate' => '2022-12-05 00:00:00', 'expiryDate' => '2023-12-05 00:00:00', ], ]; echo (new ArrayToTable($data)) ->render();
| id | firstName | transactionId | refunded | purchaseDate | expiryDate |
|---|---|---|---|---|---|
| 1 | John | A1-2019 | 0 | 2019-12-01 00:00:00 | 2020-12-01 00:00:00 |
| 2 | Mark | A1-2020 | 0 | 2020-12-05 00:00:00 | 2021-12-05 00:00:00 |
| 3 | Joe | A1-2022 | 1 | 2022-12-05 00:00:00 | 2023-12-05 00:00:00 |
You can also check the example demo.php.
tests
composer test
clean code
composer fix(-risky)
统计信息
- 总下载量: 25
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-12-05