phpbench/tabular 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

phpbench/tabular

最新稳定版本:0.4.1

Composer 安装命令:

composer require phpbench/tabular

包简介

Generate complex tables from simple configuration

README 文档

README

tabularlogo-2

Build Status StyleCI

Tabular is a library for transforming a source XML document into a tabular XML document using a given configuration. The resulting tabular XML document can then transformed or used to easily render tables (for example in HTML or in the console).

Tabular is better than spreadsheets.

Documentation

See the official documentation.

Example

The central concept is the definition file:

{
    "rows": [
        {
            "cells": [
                {
                    "name": "title",
                    "expr": "string(./title)"
                },
                {
                    "name": "price",
                    "expr": "number(./price)"
                }
            ],
            "with_query": "//book"
        },
        {
            "cells": [
                {
                    "name": "price",
                    "expr": "sum(//price)"
                }
            ]
        }
    ]
}

The above definition will generate a table representation in XML with a row for each <book/> element in the given XML file and provide an additional row showing the sum of all the <price/> elements of the <book/> element.

So given the following XML file:

    <?xml version="1.0"?>
    <store>
        <book>
            <title>War and Peace</title>
            <price>5.00</price>
        </book>
        <book>
            <title>One Hundered Years of Soliture</title>
            <price>7</price>
        </book>
    </store>

The generated table might look like this (as rendered by the Tabular CLI):

┌────────────────────────────────┬───────┐
│ title                          │ price │
├────────────────────────────────┼───────┤
│ War and Peace                  │ 5     │
│ One Hundered Years of Soliture │ 7     │
│                                │ 12    │
└────────────────────────────────┴───────┘

统计信息

  • 总下载量: 14.86k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 8
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-08-20