Download the PHP package servergrove/servergrovelocalebundle without Composer
On this page you can find all versions of the php package servergrove/servergrovelocalebundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download servergrove/servergrovelocalebundle
More information about servergrove/servergrovelocalebundle
Files in servergrove/servergrovelocalebundle
Package servergrovelocalebundle
Short Description This bundle provides a set of Twig functions to display flags in different ways
License MIT
Informations about the package servergrovelocalebundle
ServerGroveLocaleBundle
This bundle provides a set of Twig functions to display browser culture codes.
Installation
You need to follow the steps according to your Symfony version.
Specifics to Symfony 2.0
Deps
First you need to add the bundle to your deps file
and then, run the vendors script to download the bundle source
Autoload
The app must know where to look for our bundle classes. Adding the following line to the autoload file will do it.
Specifics to Symfony 2.1
Enable the bundle
Now, we need to tell our application kernel to enable the bundle. For this we need to add a bundle instance to the kernel bundles.
Configuration
Use the default settings:
Or configure it according to your requirements:
Displaying one flag
There are three helpful functions for displaying a single flag.
The flag function
The flag function displays only the flag image:
The result would be:
You can also use a third param with options.
Attributes
One of the available options is attrs, which allows to add attributes to the image.
If you set an array for a specific attribute, you would have to specify for which locale the attribute is.
The path_flag function
This bundle provides a function to display the flags with a link to a specific route.
The result would be:
The domain_flag function
It also provides a function to link the flag to a configured domain
The result would be:
Displaying multiple configured flags
With this section, you will be able to display multiple flags with just one function.
The flags function
The flags function is the equivalent for the flag function for multiple images.
The result would be:
The path_flags function
The path_flags function is the equivalent for the path_flag function for multiple images. The _locale param for the route is set automatically.
The result would be:
The domains_flags function
The domains_flags function is the equivalent for the domains_flags function for multiple images.
The result would be:
All versions of servergrovelocalebundle with dependencies
symfony/config Version ~2.1
symfony/dependency-injection Version ~2.1
symfony/finder Version ~2.1
symfony/http-kernel Version ~2.1
twig/twig Version >=1.4,<2.0