Multilanguage and Url Generator

Hi

How add a value in generated Url without change any line of my code contains CHtml::link

for example

if the requested url has the lang=en paramater then all of links in the new page get additional parameter lang=en

if page www.example.com?r=site/index&lang=en has the following links

www.example.com?r=controllA/actionA & lang=en

www.example.com?r=controllA/actionB & lang=en

www.example.com?r=controllA/actionC & lang=en

www.example.com?r=site/index&lang=gr

www.example.com?r=site/index&lang=en

then if I click www.example.com?r=site/index&lang=gr then the page should has the following

www.example.com?r=controllA/actionA & lang=gr

www.example.com?r=controllA/actionB & lang=gr

www.example.com?r=controllA/actionC & lang=gr

www.example.com?r=site/index&lang=gr

www.example.com?r=site/index&lang=en

Thanks

extending CUrlManager

Good approach Gustavo.

Firstly I tried to extend CHTml link but it is better to extend CurlManager.

I tried to Extend CurlManager and I added code in main.php in part ‘application components’

‘urlManager’=>array(

    'class'=>'MyUrlManager',

),

But when I try to run the site I get error 'Cannot redeclare class UrlManager '.

I havent redeclared in main.php about urlManager. Obviously the Capplication declares this automatically.

How to fix that?

Opps my wrong!

I wrote UrlManager extends CUrlManager { … } instead MyUrlManager extends CUrlManager { … }

Its work, Thanks!