PHP code example of jenyak / i18n-routing-service-provider
1. Go to this page and download the library: Download jenyak/i18n-routing-service-provider library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jenyak / i18n-routing-service-provider example snippets
$app->register(new Jenyak\I18nRouting\Provider\I18nRoutingServiceProvider());
$app = new Application();
//...
$app->register(new Jenyak\I18nRouting\Provider\I18nRoutingServiceProvider());
$app['locale'] = 'en';
$app['i18n_routing.locales'] = array('en', 'hu', 'ua');
// You can translate patterns
$app['translator.domains'] = array('routes' => array(
'hu' => array('test_route' => '/teszt'),
));
// There's no need to put {_locale} in route pattern
$app->get('/test', function () {
//...
})->bind('test_route');