a SensioLabs Product

The PHP micro-framework
based on the Symfony Components

You are reading the documentation for Silex 2.0. Switch to the documentation for Silex 1.3.

Questions & Feedback

License

Creative Commons License Silex documentation is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.

Locale

The LocaleServiceProvider manages the locale of an application.

Parameters

  • locale: The locale of the user. When set before any request handling, it defines the default locale (en by default). When a request is being handled, it is automatically set according to the _locale request attribute of the current route.

Services

  • n/a

Registering

1
$app->register(new Silex\Provider\LocaleServiceProvider());
Website powered by Symfony and Twig, deployed on
The Silex logo is © 2010-2017 SensioLabs