drngnh708353 2013-12-19 11:32
浏览 15
已采纳

MVC结构中的分页

Can anyone help me with how I can call a pagination function in a mvc structure?

I links look likes this after the .htaccess have done its magic:

controller/action/id

Before:

index.php?controller=&action=&id=

What i would really like to do is setting the url like

/controller/px

Where x is any int value

my .htaccess:

Options +FollowSymLinks
RewriteEngine on

RewriteRule ^([a-zA-Z]*)/?([a-zA-Z]*)?/?([a-zA-Z0-9]*)?/?$ index.php?controller=$1&action=$2&id=$3 [NC,L,QSA]

I'm hoping for some help or some pointer of any kind would be nice.

  • 写回答

2条回答 默认 最新

  • dpstir0081 2013-12-19 16:05
    关注

    You can add this rule before your existing rule:

    RewriteRule ^([a-zA-Z]+)/([0-9]+)/?$ index.php?controller=$1&action=&id=&p=$2 [L,QSA]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?