Where to put URL management code?

Dear friends,

I am a very beginner. After reading this topic:

http://www.yiiframework.com/doc/guide/1.1/en/topics.url

I seem to understand how to make my URL more beautiful, but when I actually going to code it. I am not sure where to put the URL management code, e.g.:

$url=$this->createUrl($route,$params);

array(

......


'components'=>array(


    ......


    'urlManager'=>array(


        'urlFormat'=>'path',


    ),


),

);

Can you help? Thank you!

configs/main.php

anywhere you want to create a new url using Yii (using rules defined)




$url=$this->createUrl('my/url/path',array('id'=>1));




$url=$this->createUrl($route,$params);

This goes to where you want to get your URL.


array(

......

'components'=>array(

......

'urlManager'=>array(

'urlFormat'=>'path',

),

),

);

This part should be in protected/config/main.php. Check its structure first.

Thanks!I’ll try put it in main.php.