doctorx32 / sylius-grid-json-driver-bundle
解析输入的JSON数据,以在Sylius网格中显示的驱动程序
1.2
2018-03-21 18:48 UTC
Requires
- sylius/grid-bundle: ^1.0
This package is auto-updated.
Last update: 2024-09-14 06:00:13 UTC
README
此包向SyliusGridBundle添加了json驱动程序,有助于从指定的URL获取数据并将其显示为常见的Sylius网格。
安装
- 使用Composer要求包
$ composer require doctorx32/sylius-grid-json-driver-bundle
- 在
app/AppKernel.php
中启用包
public function registerBundles() { $bundles = array( // ... new Sylius\Bundle\GridBundle\Driver\Json\SyliusGridJsonDriverBundle(), // ... ); }
- 准备您的网格,使其看起来类似以下内容
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
- 在指定的URL侧应该是Sylius Grid API响应,其中包含与步骤3中相同的字段和过滤器。