szSelectCulturePlugin - 0.1.0

szSelectCulture es un plugin que incluye un filtro y varios metodos para gestionar los idiomas y la cultura en una pagina web, lo diferencia de otros en la posibilidad de utilizar una base de datos para gestionar las culturas de la web y la de mostrar los nombres de los idiomas en los metodos de seleccion cada uno en su propio idioma

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source | Show as Markdown

szSelectCulturePlugin

szSelectCulturePlugin class provides filters and methods for maintaining url with language/culture and change it maintainig old url and component for (form select or link style selection of new language/culture)

Installation

Install the plugin:

$ symfony plugin:install szSelectCulturePlugin

Or download it and unzip in your /plugins directory

Clear you cache:

$ symfony cc

Active module in your app/[application]/config/settings.yml

enabled_modules: szSelectCulture

Change your filters in app/[application]/config/filters.yml

rendering: ~

security: ~

culture:

class: szSelectCultureFilter

cache: ~

common: ~

execution: ~

Add a route named changeculture in app/[application]/config/routing.yml

changeculture:

url: /:sf_culture/changeculture params: { module: szSelectCulture, action: index }

and add a route named localized_homepage in app/[application]/config/routing.yml

localized_homepage:

url: /:sf_culture/ param: { module: esms_home, action: index } requirements: { sf_culture: '[a-z]{2}(_[A-Z]{2})?' }

Usage

You just need to add one of the following lines of code in your template where you want to insert the select culture methods

[php]

<?php include_component('szSelectCulture', 'select') ?>

or

[php]

<?php include_component('szSelectCulture', 'links) ?>

Personalization

If you prefer any other style, create a new directory called

app/[application]/modules/szSelectCulture

and other

app/[application]/modules/szSelectCulture/templates

in templates directoy create a _select.php or _links.php file to overwrite the default layout for these methods.