library yamlpathloader
Extends the YamlFileLoader from symfony in order to load whole paths with yaml files in it. E.g. translation files.
marcschumann/yamlpathloader
Extends the YamlFileLoader from symfony in order to load whole paths with yaml files in it. E.g. translation files.
- Thursday, June 8, 2017
- by MarcSchumann
- Repository
- 2 Watchers
- 1 Stars
- 438 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 1 % Grown
, (*1)
YamlPathLoader
Extends the YamlFileLoader from Symfony in order to load whole paths with yaml files in it. E.g. translation files., (*2)
Installation
Install YamlPathLoader via your composer as follows:, (*3)
php composer.phar require marcschumann/yamlpathloader:dev-master
Usage
// Loading translations in silex microframework
$app->register(new Silex\Provider\TranslationServiceProvider());
$app['translator'] = $app->share($app->extend('translator', function($translator, $app) {
$translator->setLocale($app['locale']);
// Using YamlPathLoader - Extension for loading translation files from a directory
$translator->addLoader('yaml', new \MarcSchumann\YamlPathLoader\YamlPathLoader);
$translator->addResource('yaml', __DIR__.'/locales/en/', 'en');
$translator->addResource('yaml', __DIR__.'/locales/de/', 'de');
return $translator;
}));
dev-master
9999999-dev
Extends the YamlFileLoader from symfony in order to load whole paths with yaml files in it. E.g. translation files.
Sources
Download
Common Creative 1.0
The Requires
The Development Requires
by
Marc Schumann