There is a pages controller, ActionIndex renders a page with a CListView widget
Controller Action:

public function actionIndex() { model=new Pages(); $this->render('index',array( 'pages'=>$model, )); } 

Index view:

 $this->widget('zii.widgets.CListView', array( 'dataProvider'=>$dataProvider, 'viewData' => array( 'switch' => true ), 'enableHistory'=>true, //включаем History back 'id'=>'pages_list', 'itemView'=>'_view', 'template'=>'{pager}<br />{items}<br />{pager}', )); 

Now the actual question:
In the ListView paginator, the links look like this:

http: // localhost / pages / index / Pages_page / 1 /
http: // localhost / pages / index / Pages_page / 2 /
http: // localhost / pages / index / Pages_page / 3 /

But in the address bar the link is substituted somehow - not at all correct. Namely:

http: // localhost / pages /? / pages / index / Pages_page / 3 / =

And of course, the page does not turn over.
And if you re-go to any other page, the link will be in the form:

http: // localhost / pages /? / pages / index // pages / index / Pages_page / 3 /// ajax / pages_list / Pages_page / 4 / =

As far as I understand, it is necessary to pick in the direction of setting routes in URLManager. just do not quite understand what it is.

  • what config of routes now? - Barton

1 answer 1

Um, what's worth in .htaccess ??

perhaps RewriteBase / to help?

And further

 public function actionIndex() { model=new Pages(); // тут правильно написано? просто тут опечатался? $model должно быть. $this->render('index',array( 'pages'=>$model, )); } 

Most likely trabl in htaccess.

 ?/pages/index/Pages_page/3/= 

first sign ? should not be + at the end there is a sign = that is also nonsense. Everything else is formed correctly, but not from the root of the site, so throw a file here

  • character ? At the beginning of the link and = in the root, appear when I turn on HistoryBack. If you disable it and disable the Ajax as a whole, then the links are normalized as necessary. - Eugene