Unexpected pagination URL for CGridView

Hi Everyone,

Here is a problem with my grid view. Pagination button has unexpected URLs.


This url I’ve copied by using “Copy Link Location” is : [color="#FF0000"]http://localhost/dtci/events/calendar/index/events%2Fcalendar//EventsCalendar_page/2[/color]

But on mouse over browser show: [color="#FFA500"]http://localhost/dtci/events/calendar/index/events/calendar//EventsCalendar_page/2[/color]

But actually this should be : [color="#2E8B57"][b]http://localhost/dtci/events/calendar/index/EventsCalendar_page/2

[/b][color="#000000"]For this solution I was just reviewing the Pagination class and found one method "createPageUrl" and I found "http://localhost/dtci/events/calendar/index/[color="#FF00FF"]events%2Fcalendar[/color]//EventsCalendar_page/2" comeing from $_GET as [/color][/color][color="#2E8B57"][color="#000000"]"Array ( [events/calendar] => )".

public function createPageUrl($controller, $page) {

	$params = $this->params === null ? $_GET : $this->params;

	if ($page > 0) // page 0 is the default

    	$params[$this->pageVar] = $page + 1;



	return $controller->createUrl($this->route, $params);


See my urlManager config:

'urlManager' => array(

	'urlFormat' => 'path',

	'rules' => array(

		'about' => 'site/page/view/about',

		'thanks' => 'site/page/view/thanks',

		'contact' => 'site/contact',

		'sitemap' => 'site/sitemap',

		'sitemap.xml' => 'site/sitemapxml',

		'press-and-media' => 'site/pressandmedia',

		'privacy-and-policy' => 'site/privacyandpolicy',

		'terms-and-conditions' => 'site/termsandconditions',

		'directory-submission' => 'site/directorysubmission',

		'<controller:(download)>-<action:(s)?(doc|pdf|image|video|audio)>-<file:.*>~<timestamp:\d+>' => '<controller>/<action>',

		// Default

		'<controller:\w+>/<id:\d+>' => '<controller>/view',

		'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',

		'<controller:\w+>/<action:\w+>' => '<controller>/<action>',


	'showScriptName' => !true,


Thanks you all

[/color][/color][color="#2E8B57"] [/color]



to urlManager configuration in main.php.

I did, and the new URL for pagination button 2 is showing "localhost/dtci/events/calendar/index?events%2Fcalendar=&EventsCalendar_page=2", when I clicked on page button 2 it changes to "localhost/dtci/events/calendar/index?EventsCalendar_page=2".

And the most important thing is there is no effect on the GridView, means page 2 record is neither coming by clicking on button 1, 2, Next nor by Prev. It always showing record for page 1.