定制 uam/twig-i18n-extension 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

uam/twig-i18n-extension

最新稳定版本:0.2.9

Composer 安装命令:

composer require uam/twig-i18n-extension

包简介

Twig i18n extension

关键字:

README 文档

README

The uam/twig-i18n-extension package provides a Twig extension for internationalizing dates, numbers, etc.

Installation

Add the package to your project's composer.json:

{
    "require": {
        "uam/twig-i18n-extension": "dev-master",
        ...
    }
}

Run composer install or composer update to install the package:

$ php composer.phar update

Usage

Add the extension to the Twig_Environment:

use UAM\Twig\Extension\I18n\I18nExtension;

$twig = new Twig_Environment(...);

$twig->addExtension(new I18nExtension());

Symfony2

To use the extension in a symfony2 app, use the built-in UAMTwigI18nBundle:

Enable the bundle in your app's Appkernel:

# app/AppKernel.php
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            ...
            new UAM\Twig\Extension\I18n\Bridge\Symfony\UAMTwigI18nBundle(),
            ...
        );

The bundle will automaticallty register the UAM\Twig\Extension\I18nExtension as a twig extension.

统计信息

  • 总下载量: 22.95k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-05-30