yii-multilanguage Yii PHP Framework extension for multilingual sites

  1. Requirements
  2. Usage
  3. Resources

Create multilingual urls for your site

Requirements

  • Yii 1.1 or above

Usage

Update your config:

'components'=>array(
        #...
        # More setting http://www.yiiframework.com/doc/guide/1.1/en/topics.url
		'urlManager'=>array(
            'class'=>'ext.yii-multilanguage.MLUrlManager',
			'urlFormat'=>'path',
            'languages'=>array(
                #...
                'de',
                'el',
                'en',
                'es',
                'fr',
                'hu',
                'ja',
                'nl',
                'pl',
                'pt',
                'ro',
                'ru',
                'uk',
                #...
            ),
			'rules'=>array(
			    # ... more user rules

				'<controller:\w+>/<id:\d+>'=>'<controller>/view',
				'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
				'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',

                '<module:\w+>/<controller:\w+>/<id:\d+>/<action:\w+>'=>'<module>/<controller>/<action>',
                '<module:\w+>/<controller:\w+>/<id:\d+>'=>'<module>/<controller>/view',
                '<module:\w+>/<controller:\w+>/<action:\w+>'=>'<module>/<controller>/<action>',
                '<module:\w+>/<controller:\w+>'=>'<module>/<controller>',
                '<module:\w+>'=>'<module>',

                # ...
			),
		),
		#...
    ),

Resources

3 0
16 followers
1 304 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Others
Developed by: mishamx
Created on: May 22, 2012
Last updated: 5 years ago

Downloads

show all

Related Extensions