crowdvalley / crowdentials-api-wrapper-bundle
该包已被放弃,不再维护。未建议替代包。
提供将 crowdvalley/crowdentials-api-wrapper 库集成到 Symfony2 框架中
dev-master
2014-11-18 05:55 UTC
Requires
- php: >=5.3.0
- crowdvalley/crowdentials-api-wrapper: 0.1.*
- symfony/framework-bundle: 2.5.*
This package is not auto-updated.
Last update: 2016-10-07 17:27:45 UTC
README
提供将 crowdvalley/crowdentials-api-wrapper 库集成到 Symfony2 框架中。
安装
步骤 1:通过 composer 安装
首先,将其添加到您的 composer.json 文件中的依赖列表中
{
"require": {
"crowdvalley/crowdentials-api-wrapper-bundle": "dev-master"
}
}
然后使用 composer 安装
$> composer update crowdvalley/crowdentials-api-wrapper-bundle
步骤 2:启用包
在内核中启用该包
<?php
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new Crowdvalley\CrowdentialsApiWrapperBundle\CrowdvalleyCrowdentialsApiWrapperBundle(),
);
}
步骤 3:配置包
将以下配置添加到您的 config.yml 文件中。
# app/config/config.yml
crowdvalley_crowdentials_api_wrapper:
# Your private api key
api_key: 'your-key'
# The base url
base_url: 'http://sandbox.crowdentials.com/cai/api/v2'
使用
现在您可以使用服务 crowdentials_api
/** @var \Crowdvalley\Crowdentials\Api\Accreditation\Wrapper $api */
$api = $this->getContainer()->get('crowdentials_api');
您可以在此处了解更多有关 API 包装器的信息 这里.