2gis / api-symfony-bundle
2GIS Web API 的 Symfony Bundle
dev-master
2015-01-25 12:35 UTC
Requires
- php: >=5.3.3
- 2gis/api-client: 0.2-alpha
- symfony/framework-bundle: ~2.0
Requires (Dev)
- phpunit/phpunit: 4.*
This package is not auto-updated.
Last update: 2024-09-28 16:41:31 UTC
README
将 2GIS API 集成到基于 Symfony2 的项目的 Bundle。提供者包装 2gis/api-client
组件。
安装
#### 修改 composer.json 扩展
{ "require": { "2gis/api-symfony-bundle": "dev-master" } }
安装包
在项目目录中运行 composer update
注册 Bundle
// app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new DGis\Bundle\ApiBundle\DGisApiBundle(), ); // ... } // ... }
添加配置
#app/config.yml # ... d_gis_api: key: %dgis_key%
定义参数
#app/parameters.yml parameters: # ... dgis_key: test
使用
d_gis_api
参数
key
- 访问 API 的唯一 密钥,必填参数。class_map
- API 实体与应用程序类的映射数组,例如Address: \MyCustomAddress
。默认使用客户端库中的类。
服务
gdis.api.region
- 区域 APIgdis.api.catalog
- 目录 APIgdis.api.transport
- 交通 APIgdis.api.geo
- 地理数据 API
许可证
- 库在
MIT
许可下提供 - 关于 2GIS API 的法律信息