Hi so I am new to using Yii but not PHP in general.
I am having a problem on getting the URL’s to structure correctly. Using the blog demo included when downloading the framework I want to have the URL for the frontpage posts like this hxxp://domain.com/post/page/2
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'rules'=>array(
'post/<id:\d+>/<title:.*?>'=>'post/view',
'posts/<tag:.*?>'=>'post/index',
'post/page/<Post_page:\d+>'=>'post/index',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
That does not work and returns saying can’t find action “page”. If I make it
'post/index/page/<Post_page:\d+>'=>'post/index',
It works until after the first page is clicked then eventually leading to a url like
http://domain.com/post/index?page=2%3Fpage%3D3%3Fpage%3D2
I am wondering how I can get the url to show as I want it to.
Server is set correctly as other pages work without a problem.
Request URI and Query string parsed to server
["QUERY_STRING"]=>string(20) "r=/post/index/page/2"
["REQUEST_URI"]=>string(18) "/post/index/page/2"
I disabled the AJAX load on the CListView widget with ‘ajaxUpdate’=>false no other changes were made.
I think this is just a simple thing but I can’t find any help in http://www.yiiframework.com/doc/guide/1.1/en/topics.url to fix the problem.
Any help would be great.
Thanks,
Matt