2017 © Pedro Peláez
 

library silex-i18n-routing-service-provider

Silex i18n routing service provider.

image

ehibes/silex-i18n-routing-service-provider

Silex i18n routing service provider.

  • Thursday, February 4, 2016
  • by ehibes
  • Repository
  • 1 Watchers
  • 1 Stars
  • 32 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

I18n Routing Service Provider Build Status

Silex i18n routing service provider inspired by jenyak I18nRoutingServiceProvider, (*1)

Installation

Recommended installation is through composer. Just add the following to your composer.json file:, (*2)

Silex 1.3

{
    "require": {
        "ehibes/i18n-routing-service-provider": "~1.0"
    }
}

Silex 2

{
    "require": {
        "ehibes/i18n-routing-service-provider": "dev-master"
    }
}

Registering

$app->register(new Ibes\I18nRouting\Provider\I18nRoutingServiceProvider());

Parameters

  • i18n_routing.locales: Routing locales. The default value is array(en).
  • locale: Default routing locale. The default value is en.

Example

$app = new Application();
//...
$app->register(new Ibes\I18nRouting\Provider\I18nRoutingServiceProvider());
$app['locale'] = 'en';
$app['i18n_routing.locales'] = array('en', 'eu', 'fr');

// There's no need to put {_locale} in route pattern
$app->get('/test', function () {
   //...
})->bind('test_route')->getRoute()->setOption('i18n', array('eu' => 'entsegu-bat'));

Matched URLs will be:, (*3)

/en/test - url for default locale with prefix, (*4)

/eu/entsegu-bat - url with prefix and translated, (*5)

/fr/test - url with prefix, (*6)

The Versions

04/02 2016

dev-master

9999999-dev

Silex i18n routing service provider.

  Sources   Download

MIT

The Requires

 

The Development Requires

silex i18n routing

04/02 2016

1.0.x-dev

1.0.9999999.9999999-dev

Silex i18n routing service provider.

  Sources   Download

MIT

The Requires

 

The Development Requires

silex i18n routing