Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

Manage the language of your CakePHP 2.x application with a parameter in the URL

License

Notifications You must be signed in to change notification settings

EtienneLamoureux/CakePHP-URL-parameter-language

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

CakePHP-URL-parameter-language

Manage the language of your CakePHP 2.x application with a parameter in the URL

Installation

To install this functionality to your CakePHP application, simply copy the "app" folder of this project into a new CakePHP application. If your application isn't a brand-new CakePHP installation, you may have to copy and paste the individual functions/lines into the right files. For complete installation notes, visit this link.

Usage

The unmodified files of this project add a mandatory language parameter to the URL of your application, except for "Home". Your application's URLs will look like:

http://www.example.com/en/controller/action

You should be able to change the language of the current page by changing only the language parameter in the URL. To generate a generic language-changing link, use a variant of the following in your layouts or views:

echo $this->Html->link('Français', array('language'=>'fr'));

Other

For a concrete example of the LanguageComponent in action, visit http://www.crystalgorithm.com

Original idea by Dorin Moise

About

Manage the language of your CakePHP 2.x application with a parameter in the URL

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages