[英]Pagination not working for CLinkPager in yii1
I used widget "clinkpager". 我使用了widget“clinkpager”。 It appears on page when i click on 2nd,3rd .... page.
当我点击第2,第3 ......页面时,它出现在页面上。 I wont moved on next page.
我不会在下一页上移动。 Even next and previous also not works there.
即使是下一次和之前也没有在那里工作。
<?php
$this->widget('CLinkPager', array(
'pages' => $pages,
'currentPage'=>$pages->getCurrentPage(),
'pageSize'=>$page_size,
'itemCount'=>$count,
'header'=>'',
));?>
When i click on "next" then the url changed in the browser. 当我点击“下一步”,然后在浏览器中更改了网址。 http://localhost/mate/admin/site/pricelisting/89-Malouf-Zoned-Gel-Dough/page/2
HTTP://本地主机/伴侣/管理/网站/ pricelisting / 89-马洛夫划-凝胶面团/页/ 2
but it will not move on 2nd page. 但它不会在第二页上移动。
instead of above URL if i use below url then it move to the page http://localhost/mate/admin/site/pricelisting/89-Malouf-Zoned-Gel-Dough?page=2 如果我使用下面的URL,而不是上面的URL,那么它移动到页面http:// localhost / mate / admin / site / pricelisting / 89-Malouf-Zoned-Gel-Dough?page = 2
.htaccss file .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]
I don't have any idea. 我什么都不知道。 Please suggest me what is wrong there.
请告诉我那里有什么问题。
I think this is due to your rewrite rules 我认为这是由于你的重写规则
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]
They would reqrite [...]/page2
to the according page, since there is a /
missing between page and the number placeholder - if I'm not completely wrong. 他们会将
[...]/page2
重新命名为相应的页面,因为页面和数字占位符之间存在/
缺失 - 如果我没有完全错误的话。 Change them to 将它们更改为
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]
and I believe that it should work. 我相信它应该有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.