2gis/api-silex-provider

2GIS Web API 的 Silex 提供者

dev-master 2015-01-25 12:39 UTC

This package is not auto-updated.

Last update: 2024-09-28 17:33:14 UTC


README

Build Status Scrutinizer Code Quality

2GIS 数据提供者的 Silex 扩展。提供者包装了 2gis/api-client 组件。

安装

composer

{
    "require": {
        "2gis/api-silex-provider": "dev-master"
    }
}

注册提供者

    use DGis\Silex\Api\Provider\DGisApiServiceProvider;
    // ...
    $app->register(new DGisApiServiceProvider(), array(
        'dgis.api.options' => array(
            'key' => 'test',
        ),
    ));

使用

参数

  • key - 访问 API 的唯一 密钥,必填参数。
  • mapper_factory - API 实体映射器工厂类,用于将 API 实体映射到应用程序对象。默认使用标准映射器。
  • class_map - API 实体与应用程序类之间的映射数组,例如 'Address' => '\MyCustomAddress'。默认使用客户端库中的类。

服务

许可证