langurlmanager Multilingual Url Manager

  1. Documentation
  2. Change Log

This extension allows you to pass the application language via an url and then use it for all further generated urls (within the application itself). It can use the user preffered language as a default initial language.

Resources

Documentation

Requirements
  • Yii 1.0 or above
Installation
  • Extract the release file under protected/extensions/urlManager/
Usage

See the following code example:

'components'=>array(
....
        'urlManager'=>array(
            'class'=>'application.extensions.urlManager.LangUrlManager',
            'languages'=>array('ru','uk'),
            'langParam'=>'language',
        ),
...
)

Your can share the change language link follow this example:

<?php echo CHtml::link('<span class="ru">по-русски</span>',array(Yii::app()->defaultController.'/',Yii::app()->urlManager->langParam=>'ru'),array(
                    'class'=>((Yii::app()->language=='ru') ? 'action':''),
                ));?>
                <?php echo CHtml::link('<span class="ua">украiнською</span>',array(Yii::app()->defaultController.'/',Yii::app()->urlManager->langParam=>'uk'),array(
                    'class'=>((Yii::app()->language=='uk') ? 'action':''),
                ));?>

Change Log

December 5, 2009
  • v1.0 final release.
  • v1.2 added: support of parsing language url parameters in path format
9 2
5 followers
2 305 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Others
Tags:
Developed by: Ekstazi
Created on: Dec 5, 2009
Last updated: 14 years ago

Downloads

show all