dougu5886 2015-08-09 04:54
浏览 57

yii1与url-manager分页

i have problem with yii1 pagination this is my url manage config:

'rules' => array(
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>/<slug:\w+>' => '<controller>/<action>',
'adminproduces/producelist/<slug:\w+>/<id:\w+>' => 'adminproduces/producelist',
'adminrequests/requestlist/<slug:\w+>/<id:\w+>' => 'adminrequests/requestlist',
'userrequest/neworder/<type:\w+>/<slug:\w+>' => 'userrequest/neworder',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
),

every thing ok ,but when i use pagination the created url is not matched with my urlmanger config this my requested Url: "/adminrequests/requestlist/digital/status10021" that match with line 5 of url manger .... in same page i use

<?php
// the pagination widget with some options to mess
$this->widget('CLinkPager', array('pages' => $pages));
?>

but when run project the link create this link for next pages "adminrequests/requestlist/status10021?slug=digital&page=2" insted of "adminrequests/requestlist/digital/status10021?page=2" why? can ypu help me please ? when i manualy type "adminrequests/requestlist/digital/status10021?page=2" in address bar next page loaad correctly.... but pagination dosent make correct links...

  • 写回答

1条回答 默认 最新

  • dongpo2340 2015-08-09 05:30
    关注

    Yii's CPagination has route property. You can use this for your need. Something like this:

    $pages->route = "adminrequests/requestlist/digital/status10021";
    

    You should usually set the part of url which is before starting pagination part.

    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度