bogdanfinn / the-games-db-bundle
用于访问 http://thegamesdb.net/ Api 的 symfony 扩展包
1.0.0
2017-07-23 15:56 UTC
Requires
- php: >=5.4.0
- guzzlehttp/guzzle: ~6.0
- symfony/config: >=2.3,<4
- symfony/dependency-injection: >=2.3,<4
- symfony/event-dispatcher: >=2.3,<4
- symfony/http-kernel: >=2.3,<4
- twig/twig: ~1.11|~2.0
Requires (Dev)
- phpunit/phpunit: ^4.8
- symfony/framework-bundle: >=2.3,<4
This package is not auto-updated.
Last update: 2024-09-29 03:15:29 UTC
README
这是一个用于访问 http://thegamesdb.net/ Api 的 symfony 扩展包
安装步骤
第1步:下载扩展包
打开命令行控制台,进入您的项目目录,并执行以下命令以下载此扩展包的最新稳定版本
$ composer require bogdanfinn/the-games-db-bundle
此命令需要您全局安装了 Composer,具体请参考 Composer 文档中的安装章节。
第2步:启用扩展包 / 配置
然后,通过将其添加到项目 app/AppKernel.php 文件中注册的扩展包列表中来启用扩展包
<?php
// app/AppKernel.php
// ...
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
// ...
new bogdanfinn\TheGamesDbBundle\TheGamesDbBundle(),
);
// ...
}
// ...
}
第3步:使用方法
在您的控制器中获取 GameClient
$gameClient = $this->get('theGamesDb_game_client');
方法
GameClient
$games = $gameClient->searchGame("Battlefield");
$game = $gameClient->getGameById(2);