創建網址我想獲得的網址如下:Yii的路線,並與多個參數
http://domain.com/post/1/some-titles-here
但我發現了:
http://domain.com/post/1?title=some-titles-here
我正在使用此配置:
'urlFormat' => 'path',
...
//'post/<id:\d+>/<title>' => 'post/view/',
'post/<id:\d+>/<title:\w+>' => 'post/view/',
'post/<id:\d+>' => 'post/view/',
...
然後獲取URL我執行:在此下面
Yii::app()->createAbsoluteUrl('post/view', array('id' => $this->id,'title' => $this->title));
IM第三條規則: http://www.yiiframework.com/doc/guide/1.1/en/topics.url#using-named-parameters
嘿,我認爲這是符合這樣的: '交/'=>'post/view /' 您可以嘗試: 'post//*'=>'post/view /', –
Tuan
2013-04-30 20:03:17
您好Jeroes,相同的輸出。 – user2337304 2013-04-30 20:09:19
即時通訊關於此文檔的第三條規則:http://www.yiiframework.com/doc/guide/1.1/en/topics.url#using-named-parameters – user2337304 2013-04-30 20:11:02