[英]Pagination not working for CLinkPager in yii1
我使用了widget“clinkpager”。 当我点击第2,第3 ......页面时,它出现在页面上。 我不会在下一页上移动。 即使是下一次和之前也没有在那里工作。
<?php
$this->widget('CLinkPager', array(
'pages' => $pages,
'currentPage'=>$pages->getCurrentPage(),
'pageSize'=>$page_size,
'itemCount'=>$count,
'header'=>'',
));?>
当我点击“下一步”,然后在浏览器中更改了网址。 HTTP://本地主机/伴侣/管理/网站/ pricelisting / 89-马洛夫划-凝胶面团/页/ 2
但它不会在第二页上移动。
如果我使用下面的URL,而不是上面的URL,那么它移动到页面http:// localhost / mate / admin / site / pricelisting / 89-Malouf-Zoned-Gel-Dough?page = 2
.htaccss文件
RewriteEngine on
RewriteCond %{HTTP_HOST} ^localhost/mate/admin$ [NC,OR]
RewriteCond %{HTTP_HOST} ^localhost/mate/admin$
RewriteCond %{REQUEST_URI} !wordpress/
RewriteRule (.*) /wordpress/$1 [L]
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
RewriteRule details/(.*)/(.*)/ site/details?id=$1&name=$2
RewriteRule details/(.*)/(.*) site/details?id=$1&name=$2
RewriteRule pricelisting/(.*)-(.*)/ site/pricelisting?id=$1&name=$2?page=$3 [L,QSA]
RewriteRule pricelisting/(.*)-(.*) site/pricelisting?id=$1&name=$2?page=$3 [L,QSA]
#RewriteRule pricelisting/(.*)-(.*)/ site/pricelisting?id=$1&name=$2
#RewriteRule pricelisting/(.*)-(.*) site/pricelisting?id=$1&name=$2
#RewriteRule pricelisting/(.*)-(.*)/page(.*)/ site/pricelisting?page=$3 [L,QSA]
#RewriteRule pricelisting/(.*)-(.*)/page(.*) site/pricelisting?page=$3 [L,QSA]
RewriteRule ^pricelisting/(.*)-(.*)/page(.*)/ site/pricelisting?id=$1&name=$2&page=$3 [L,QSA]
RewriteRule ^pricelisting/(.*)-(.*)/page(.*) site/pricelisting?id=$1&name=$2&page=$3 [L,QSA]
我什么都不知道。 请告诉我那里有什么问题。
我认为这是由于你的重写规则
RewriteRule ^pricelisting/(.*)-(.*)/page(.*)/ site/pricelisting?id=$1&name=$2&page=$3 [L,QSA]
RewriteRule ^pricelisting/(.*)-(.*)/page(.*) site/pricelisting?id=$1&name=$2&page=$3 [L,QSA]
他们会将[...]/page2
重新命名为相应的页面,因为页面和数字占位符之间存在/
缺失 - 如果我没有完全错误的话。 将它们更改为
RewriteRule ^pricelisting/(.*)-(.*)/page/(.*)/ site/pricelisting?id=$1&name=$2&page=$3 [L,QSA]
RewriteRule ^pricelisting/(.*)-(.*)/page/(.*) site/pricelisting?id=$1&name=$2&page=$3 [L,QSA]
我相信它应该有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.