doctorx32/sylius-grid-json-driver-bundle

解析输入的JSON数据,以在Sylius网格中显示的驱动程序

安装: 333

依赖者: 0

建议者: 0

安全: 0

星标: 2

关注者: 1

分支: 1

开放问题: 0

类型:symfony-bundle

1.2 2018-03-21 18:48 UTC

This package is auto-updated.

Last update: 2024-09-14 06:00:13 UTC


README

此包向SyliusGridBundle添加了json驱动程序,有助于从指定的URL获取数据并将其显示为常见的Sylius网格。

安装

  1. 使用Composer要求包
$ composer require doctorx32/sylius-grid-json-driver-bundle
  1. app/AppKernel.php中启用包
public function registerBundles()
{
  $bundles = array(
    // ...
    new Sylius\Bundle\GridBundle\Driver\Json\SyliusGridJsonDriverBundle(),
    // ...
  );
}
  1. 准备您的网格,使其看起来类似以下内容
sylius_grid:
    grids:
        app_admin_supplier:
            driver:
                name: json
                options:
                    url: "/api/v1/products/"
                    host: "https://:8000"
            fields:
                "[name]":
                    type: string
                "[code]":
                    type: string
            filters:
                search:
                    type: string
  1. 在指定的URL侧应该是Sylius Grid API响应,其中包含与步骤3中相同的字段和过滤器。