【发布时间】:2012-08-24 08:41:53
【问题描述】:
控制器 pages,ActionIndex 使用小部件 CListView
呈现页面
在控制器中:
公共函数 actionIndex ()
{
模型 = 新页面 ();
$ this-> render ('index', array (
'pages' => $ 模型,
));
}
查看索引:
$ this-> 小部件('zii.widgets.CListView',数组(
'dataProvider' => $ dataProvider,
'viewData' => 数组 ('switch' => true),
'enableHistory' => 真, 'id' => 'pages_list',
'itemView' => '_view',
'模板' => '{pager}
{items}
{pager}',
));
现在是实际问题:
在 ListView 分页器中,链接如下所示:
http://localhost/pages/index/Pages_page/1/
http://localhost/pages/index/Pages_page/2/
http://localhost/pages/index/Pages_page/3/
但在地址栏中作为链接插入 - 这不正确。它们是:
http://localhost/pages/?/pages/index/Pages_page/3/=
当然,不要翻页。
如果您重新移动到任何其他页面,则链接已经采用以下形式:
http://localhost/pages/?/pages/index//pages/index/Pages_page/3///ajax/pages_list/Pages_page/4/ =
据我了解,有必要选择侧边设置路由到URLManager'e。
只是不确定它是什么。
【问题讨论】:
标签: php ajax yii browser-history