This bundle adds json driver to SyliusGridBundle, which helps get data from specified url and display it as common Sylius Grid.
- require the bundle with Composer:
$ composer require doctorx32/sylius-grid-json-driver-bundle
- enable the bundle in
app/AppKernel.php
:
public function registerBundles()
{
$bundles = array(
// ...
new Sylius\Bundle\GridBundle\Driver\Json\SyliusGridJsonDriverBundle(),
// ...
);
}
- prepare your grid for looking similar as:
sylius_grid:
grids:
app_admin_supplier:
driver:
name: json
options:
url: "/api/v1/products/"
host: "http://localhost:8000"
fields:
"[name]":
type: string
"[code]":
type: string
filters:
search:
type: string
- on the specified url side should be Sylius Grid api response, which contains fields and filters with same names as in step 3.