nettrinity
(Thanhvn Info)
March 17, 2011, 12:36pm
1
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!
gusnips
(Gustavo)
March 17, 2011, 12:39pm
2
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));
samdark
(Alexander Makarov)
March 17, 2011, 12:40pm
3
$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.
nettrinity
(Thanhvn Info)
March 17, 2011, 1:30pm
4
Thanks!I’ll try put it in main.php.
nettrinity:
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!