自行修改页码显示方式 增加 _currentPage of _totalPage 出现第0页

模板开发以及发布测试

版主: seita

回复
﹎sκyˊ☆
帖子: 41
注册时间: 2008年 9月 10日 08:35
联系:

自行修改页码显示方式 增加 _currentPage of _totalPage 出现第0页

帖子 ﹎sκyˊ☆ »

varTypechoWidgetHelperPageNavigatorBox.php
44行

代码: 全选

        //输出上一页
        if ($this->_currentPage >= 1) {
            echo '<span class="pages">Page ' . $this->_currentPage . ' of ' . $this->_totalPage .'</span><a href="' . str_replace($this->_pageHolder, $this->_currentPage - 1, $this->_pageTemplate) . '">'
            . $prevWord . '</a>';
        }

当第一页时怎么不出现上一页(即第0页)

代码: 全选

$this->_currentPage - 1
头像
zyzzc
帖子: 648
注册时间: 2009年 9月 25日 20:11
联系:

Re: 自行修改页码显示方式 增加 _currentPage of _totalPage 出现第0页

帖子 zyzzc »

干嘛要改成>= ?
﹎sκyˊ☆
帖子: 41
注册时间: 2008年 9月 10日 08:35
联系:

Re: 自行修改页码显示方式 增加 _currentPage of _totalPage 出现第0页

帖子 ﹎sκyˊ☆ »

[quote="zyzzc"]干嘛要改成>= ?[/quote]
有更好的办法?
头像
joyqi
帖子: 422
注册时间: 2007年 7月 24日 19:43
联系:

Re: 自行修改页码显示方式 增加 _currentPage of _totalPage 出现第0页

帖子 joyqi »

因为没有第0页
﹎sκyˊ☆
帖子: 41
注册时间: 2008年 9月 10日 08:35
联系:

Re: 自行修改页码显示方式 增加 _currentPage of _totalPage 出现第0页

帖子 ﹎sκyˊ☆ »

不加"="号的话 page xx of xx 只出现在第2页或以后



加了"="号 出现在第一页 第一页也出现上一页 即第0页
回复