0
votes

A controller pages, ActionIndex renders the page with the widget CListView
In the controller:

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

View Index:

     $ this-> widget ('zii.widgets.CListView', array (
     'dataProvider' => $ dataProvider,
         'viewData' => array ('switch' => true),
         'enableHistory' => true,          'id' => 'pages_list',
     'itemView' => '_view',
         'template' => '{pager}
{items}
{pager}',
     ));

Now the actual question:
In a ListView paginatore links look as follows:

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 as a link is inserted - that does not correctly. These are:

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

And of course, do not flip over the page.
And if you re-move to any other page, the link is already in the form of:

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

As far as I understand it, it is necessary to pick the side settings are routed to URLManager'e.
just not sure what it was.

3

3 Answers

0
votes

Your controller code has some mistakes. Use the following for actionIndex().

/**
 * Lists all models.
 */
public function actionIndex()
{
    $dataProvider=new CActiveDataProvider('Pages');
    $this->render('index',array(
        'dataProvider'=>$dataProvider,
    ));
}

I tested your view index.php code and it works fine.

0
votes

If you disable enableHistory works fine. The real solution I don´t find it

0
votes

Try removing the

'id' => 'pages_list',

in view.