smrtr/datagrid 问题修复 & 功能扩展

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

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

smrtr/datagrid

Composer 安装命令:

composer require smrtr/datagrid

包简介

Smrtr DataGrid is a searchable backend datagrid class with applications in data management, analysis and reporting.

README 文档

README

A tool for working with 2d arrays, spreadsheets and data grids in PHP.

Examples

use Smrtr\DataGrid;

$grid = new DataGrid(
  array(
      array("First name", "Last Name", "Position", "Age"),
      "WR" => array("Wayne", "Rooney", "striker", 27),
      "KG" => array("Kieran", "Gibbs", "left back", 23),
      "GB" => array("Gareth", "Barry", "midfielder", 32),
      "TW" => array("Theo", "Walcott", "striker", 24)
  ),
  DataGrid::ASSOC_COLUMN_FIRST,
  DataGrid::ASSOC_ROW_KEYS
);

$grid->saveCSV('/path/to/file.csv');

$grid->serveJSON('download.json');

$grid2 = new DataGrid;
$grid2->loadCSV('/path/to/file.csv', true, true);

print_r(
  $grid
    ->searchRows('Age<25 + Position=striker')
    ->getRowLabels()
); // [ "TW" ]

print_r(
  $grid
    ->searchRows('Age<25 - Position=striker')
    ->getRowLabels()
); // [ "KG" ]

print_r(
  $grid
    ->searchRows('Age<30 + (Position="left back" , Position=midfielder)')
    ->getRowLabels()
); // [ "KG" ]

print_r(
  $grid
    ->searchRows('(Age<30 + Position="left back") , Position=midfielder')
    ->getRowLabels()
); // [ "KG", "GB" ]

echo $grid->row('WR')['First name']; // "Wayne"

$grid->renameColumn('First name', 'Forename');

$s = serialize($grid);

$grid = unserialize($s);

$inverse = $grid->transpose();

echo ($grid->getRowKeys() === $inverse->getColumnKeys()) ? 'Y' : 'N'; // "Y"

Install with composer

{
    "require": {
        "smrtr/datagrid": ">=1.3.2"
    }
}

composer update

Tutorial

Click here.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-08-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固