定制 cekurte/silex-translation-provider 二次开发

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

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

cekurte/silex-translation-provider

最新稳定版本:v0.0.6

Composer 安装命令:

composer require cekurte/silex-translation-provider

包简介

A silex service provider that adds loader (translation) from yaml files

README 文档

README

Build Status Code Climate Coverage Status Latest Stable Version License SensioLabsInsight

  • A simple silex service provider (with all methods covered by php unit tests) that adds the Yaml files to the Silex\Provider\TranslationServiceProvider to increase the power of your application, contribute with this project!

Installation

The package is available on Packagist. The source files is PSR-2 compatible. Autoloading is PSR-4 compatible.

composer require cekurte/silex-translation-provider

Documentation

To use this library you need register the Cekurte\Silex\Translation\Provider\TranslationServiceProvider.

<?php

use Cekurte\Silex\Translation\Provider\TranslationServiceProvider;

// ...

$app->register(new TranslationServiceProvider(), [
    'translation.directory' => realpath(__DIR__ . '/../your-translation-directory')
]);

// ...

And create in your-translation-directory/ the translation yaml files, note that the filename must be the locale name. Then, the following filenames are valid:

  • en.yaml
  • en.yml
  • es.yaml
  • es.yml
  • fr.yaml
  • fr.yml
  • ...

If you liked of this library, give me a star =).

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Make your changes
  4. Run the tests, adding new ones for your own code if necessary (vendor/bin/phpunit)
  5. Commit your changes (git commit -am 'Added some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create new Pull Request

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-28