alitvinenko / google-api-bundle
此包的最新版本(0.1.1)没有可用的许可信息。
Symfony2 Google API 包
0.1.1
2015-08-04 08:04 UTC
Requires
- php: >=5.3.0
- kriswallsmith/buzz: ~0.7
- symfony/symfony: 2.7.*
This package is not auto-updated.
Last update: 2024-09-28 18:47:56 UTC
README
安装
步骤 1: 下载包
打开命令控制台,进入您的项目目录,并执行以下命令以下载此包的最新版本
$ composer require alitvinenko/google-api-bundle dev-master
此命令要求您全局安装了Composer,具体请参考Composer文档中的安装章节。
步骤 2: 启用包
然后,通过将其添加到项目中的app/AppKernel.php
文件中注册的包列表中来启用该包
<?php // app/AppKernel.php // ... class AppKernel extends Kernel { public function registerBundles() { $bundles = array( // ... new Alitvinenko\GoogleApiBundle\AlitvinenkoGoogleApiBundle(), ); // ... } // ... }
用法
在您的config.yml
中配置Alitvinenko Google Api 包
# app/config/config.yml alitvinenko_google_api: key: <your google api key>
代码示例
$this->getContainer()->get('alitvinenko_google_api')->getLanguage()->translate($words);