定制 herrera-io/silex-translation-files 二次开发

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

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

herrera-io/silex-translation-files

最新稳定版本:1.1.0

Composer 安装命令:

composer require herrera-io/silex-translation-files

包简介

A Silex service provider for using translation files.

README 文档

README

Build Status

This is a Silex service provider that extends the existing Translation service in order to more easily support the use of translation files. You can specify the loader, the files, and the locales all as a parameter.

Example

use Herrera\Silex\Provider\TranslationServiceProvider;
use Silex\Application;

$app = new Application();

$app->register(
    new TranslationServiceProvider(),
    array(
        'translation.files' => array(
            'Symfony\\Component\\Translation\\Loader\\YamlFileLoader' => array(
                '/path/to/file.de.yml' => 'de',
                '/path/to/file.en.yml' => 'en',
                '/path/to/file.fr.yml' => 'fr'
            )
        )
    )
);

$translated = $app['translator']->trans($key);

Installation

Use Composer:

$ composer.phar require "herrera-io/silex-translation-files=~1.0"

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-08-15