[英]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.