Yii 1.1: yii-multilanguage

Yii PHP Framework extension for multilingual sites
15 followers

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

Total 3 comments

#17768 report it
santosh joshi at 2014/07/21 06:03am
I have use the extension and getting error

Hello,

any body can give my answer . Actually i am using this extension but a facing error like

CUrlManager and its behaviors do not have a method or closure named "createAbsoluteLanguageUrl".

D:\xampp\yii-framework\framework\base\CComponent.php(266)

if possible. please give my answer.

thnaks && regards.

Santosh joshi

#8744 report it
ibo_s at 2012/06/22 06:03pm
URL

I'm looking for something like this domain.com/de/controller/action domain.com/en/controller/action

Can I realize it with this URL Manager ?

Thanks !

#8284 report it
schmunk at 2012/05/23 12:42am
How do the URLs look then?

... and by the way: Could you please also have a look at: http://www.yiiframework.com/extension/yii-user#c8061 which is mainly referring to this discussion.

Thanks!

Leave a comment

Please to leave your comment.

Create extension