connectsb/localebundle
Composer 安装命令:
composer require connectsb/localebundle
包简介
Bundle for managing locales
README 文档
README
With this bundle you can get the country names of locales.
1) Installation
First you have to add the folowing lines to your composer.json file:
{ "require": { "connectsb/localebundle": "dev-master" } }
You also have to add the LocaleBundle to your AppKernel.php:
class AppKernel extends Kernel { public function registerBundles() { $bundles = array( ... new ConnectSB\TranslationBundle\ConnectSBLocaleBundle() ); } }
2) Usage
In the controller you can get the country of the language with the following method:
$this->get('connect_sb_locale_service')->getCountryOfLocale('en');
In Twig you can use the locale_to_country filter.
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-12-16