<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: 一个巧妙的分页方法</title>
	<atom:link href="http://www.laruence.com/2008/10/28/567.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.laruence.com/2008/10/28/567.html</link>
	<description>PHP语言, PHP扩展, Zend引擎相关的研究,技术,新闻分享 - 左手代码 右手诗</description>
	<lastBuildDate>Thu, 09 Feb 2012 12:31:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
	<item>
		<title>By: k</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-4584</link>
		<dc:creator>k</dc:creator>
		<pubDate>Sun, 10 Jul 2011 05:13:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-4584</guid>
		<description>鸟哥~~ 
$page_str .= &lt;&lt;&lt;HTML
                        de_next_class}&quot;&gt; {$this-&gt;next_str} 
HTML;
您这样写是因为效率还是为了整洁啊?
这个好处是什么?</description>
		<content:encoded><![CDATA[<p>鸟哥~~<br />
$page_str .= &lt;&lt;&lt;HTML<br />
                        de_next_class}&#8221;&gt; {$this-&gt;next_str}<br />
HTML;<br />
您这样写是因为效率还是为了整洁啊?<br />
这个好处是什么?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 看到一个分页的算法&#124; 茗梓&#8212;致力于web开发</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-4481</link>
		<dc:creator>看到一个分页的算法&#124; 茗梓&#8212;致力于web开发</dc:creator>
		<pubDate>Tue, 14 Jun 2011 15:27:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-4481</guid>
		<description>[...] 出处: http://www.laruence.com/2008/10/28/567.html [...]</description>
		<content:encoded><![CDATA[<p>[...] 出处: http://www.laruence.com/2008/10/28/567.html [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 一个巧妙的分页方法 &#124; 万维网黑客联盟</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-3954</link>
		<dc:creator>一个巧妙的分页方法 &#124; 万维网黑客联盟</dc:creator>
		<pubDate>Sun, 20 Mar 2011 10:23:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-3954</guid>
		<description>[...] 本文地址: http://www.laruence.com/2008/10/28/567.html [...]</description>
		<content:encoded><![CDATA[<p>[...] 本文地址: <a href="http://www.laruence.com/2008/10/28/567.html" rel="nofollow">http://www.laruence.com/2008/10/28/567.html</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MoontoC</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-2559</link>
		<dc:creator>MoontoC</dc:creator>
		<pubDate>Tue, 11 May 2010 22:48:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-2559</guid>
		<description>看第一句我就真经了,虽然还算实用,但是得到的东西是不是自己想要的还待考证
$total_page = ceil($total/$page_size);

ceil之类的普通数学函数属于很不严谨的一类做法,它们可以出现任何意想不到的问题,源于php的浮点精度差别,php文档下面的评论可以看到一些神奇的东西...

我想说的是,数据的格式化不足</description>
		<content:encoded><![CDATA[<p>看第一句我就真经了,虽然还算实用,但是得到的东西是不是自己想要的还待考证<br />
$total_page = ceil($total/$page_size);</p>
<p>ceil之类的普通数学函数属于很不严谨的一类做法,它们可以出现任何意想不到的问题,源于php的浮点精度差别,php文档下面的评论可以看到一些神奇的东西&#8230;</p>
<p>我想说的是,数据的格式化不足</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: xianbei</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-2485</link>
		<dc:creator>xianbei</dc:creator>
		<pubDate>Fri, 26 Mar 2010 02:38:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-2485</guid>
		<description>如果想写一个功能强大的分页类,那我建议写一个分页方面的框架吧,可以分为以下几个方面:
1、主类:用来实现分页
2、数据生成类：用来生成数据
3、现实效果类：用来现实分页的效果,这个类支持插件,自己可以随便自定义现实效果
4、插件类：用于其他一些功能

当然可能还会有其他的一些分法和功能

最重要的还是设计模式的良好运用</description>
		<content:encoded><![CDATA[<p>如果想写一个功能强大的分页类,那我建议写一个分页方面的框架吧,可以分为以下几个方面:<br />
1、主类:用来实现分页<br />
2、数据生成类：用来生成数据<br />
3、现实效果类：用来现实分页的效果,这个类支持插件,自己可以随便自定义现实效果<br />
4、插件类：用于其他一些功能</p>
<p>当然可能还会有其他的一些分法和功能</p>
<p>最重要的还是设计模式的良好运用</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zhj</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-2135</link>
		<dc:creator>zhj</dc:creator>
		<pubDate>Fri, 14 Aug 2009 10:43:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-2135</guid>
		<description>哎~这两天什么也没做，就研究你博客了。呵呵~~刚看了这篇，在找出$size个页码时我见过这种方法：
$half = ceil($size/2);
if($size-$half+$page &gt; $total) {
   $half = $size-$total+$page;
}
$begin = $page - $half + 1;
$begin = ($begin&gt;=1)? $begin : 1;
for($i=$begin;$i&lt;$begin+$size;$i++) {
    if($i&lt;=$total) {
       ....
    }
}

哎，本人才疏学浅，对于上面的和这个的思想都不是太了解，还请您指点~~不胜感激~</description>
		<content:encoded><![CDATA[<p>哎~这两天什么也没做，就研究你博客了。呵呵~~刚看了这篇，在找出$size个页码时我见过这种方法：<br />
$half = ceil($size/2);<br />
if($size-$half+$page &gt; $total) {<br />
   $half = $size-$total+$page;<br />
}<br />
$begin = $page &#8211; $half + 1;<br />
$begin = ($begin&gt;=1)? $begin : 1;<br />
for($i=$begin;$i&lt;$begin+$size;$i++) {<br />
    if($i&lt;=$total) {<br />
       &#8230;.<br />
    }<br />
}</p>
<p>哎，本人才疏学浅，对于上面的和这个的思想都不是太了解，还请您指点~~不胜感激~</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ayiaman</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-1009</link>
		<dc:creator>ayiaman</dc:creator>
		<pubDate>Sat, 03 Jan 2009 12:31:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-1009</guid>
		<description>自己也写了一个，没这么复杂，传入	
$totalNum	= $arr[&#039;totalNum&#039;];
$numPerPage     = $arr[&#039;numPerPage&#039;];
$nowPage	= $arr[&#039;nowPage&#039;];
$href		= $arr[&#039;href&#039;];
这4个参数，自己返回分页的link。就43行代码</description>
		<content:encoded><![CDATA[<p>自己也写了一个，没这么复杂，传入<br />
$totalNum	= $arr['totalNum'];<br />
$numPerPage     = $arr['numPerPage'];<br />
$nowPage	= $arr['nowPage'];<br />
$href		= $arr['href'];<br />
这4个参数，自己返回分页的link。就43行代码</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cnangel</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-410</link>
		<dc:creator>cnangel</dc:creator>
		<pubDate>Mon, 01 Dec 2008 10:07:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-410</guid>
		<description>太复杂了，呵呵</description>
		<content:encoded><![CDATA[<p>太复杂了，呵呵</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rodin</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-372</link>
		<dc:creator>Rodin</dc:creator>
		<pubDate>Fri, 21 Nov 2008 05:52:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-372</guid>
		<description>老外有一个用策略模式做的分页：

http://www.sitepoint.com/article/perfect-php-pagination/

我觉得，把关键的分界输出（最后一页，当前页，其他都是扩展参数，比如上一页，下一页，上n页下n页），至于显示，交给smarty去做即可，甚至完全写成smarty的插件也行，在插件内部用smarty fetch动态获取分页模板</description>
		<content:encoded><![CDATA[<p>老外有一个用策略模式做的分页：</p>
<p><a href="http://www.sitepoint.com/article/perfect-php-pagination/" rel="nofollow">http://www.sitepoint.com/article/perfect-php-pagination/</a></p>
<p>我觉得，把关键的分界输出（最后一页，当前页，其他都是扩展参数，比如上一页，下一页，上n页下n页），至于显示，交给smarty去做即可，甚至完全写成smarty的插件也行，在插件内部用smarty fetch动态获取分页模板</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 雪候鸟</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-350</link>
		<dc:creator>雪候鸟</dc:creator>
		<pubDate>Fri, 14 Nov 2008 18:50:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-350</guid>
		<description>恩,这个conf是我留下做特殊定制的,一般不需要.</description>
		<content:encoded><![CDATA[<p>恩,这个conf是我留下做特殊定制的,一般不需要.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vincent</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-349</link>
		<dc:creator>Vincent</dc:creator>
		<pubDate>Fri, 14 Nov 2008 10:31:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-349</guid>
		<description>我觉得你要关心的是这个思想， 不用太在意这个类。
作者的本意，也只是一个思想么。</description>
		<content:encoded><![CDATA[<p>我觉得你要关心的是这个思想， 不用太在意这个类。<br />
作者的本意，也只是一个思想么。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 无名</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-348</link>
		<dc:creator>无名</dc:creator>
		<pubDate>Fri, 14 Nov 2008 09:57:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-348</guid>
		<description>速度啊，大哥，要下班了，给我说两下吧，今天看你的那个类都一天了，还是没有看明白，555</description>
		<content:encoded><![CDATA[<p>速度啊，大哥，要下班了，给我说两下吧，今天看你的那个类都一天了，还是没有看明白，555</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 无名</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-347</link>
		<dc:creator>无名</dc:creator>
		<pubDate>Fri, 14 Nov 2008 09:56:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-347</guid>
		<description>开始传参数时，$conf=array()，这个值开始时传什么呢? 还有就是，点击1，2，3，4，5的链接是，如何把值传传出去的呢？你的{$this-&gt;target}没法传值啊</description>
		<content:encoded><![CDATA[<p>开始传参数时，$conf=array()，这个值开始时传什么呢? 还有就是，点击1，2，3，4，5的链接是，如何把值传传出去的呢？你的{$this-&gt;target}没法传值啊</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 无名</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-346</link>
		<dc:creator>无名</dc:creator>
		<pubDate>Fri, 14 Nov 2008 09:46:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-346</guid>
		<description>大哥啊，你在线？能否给我说说 变量的意义，我看懂了类80%的东西，还差点就能用了 我QQ：492902285  方便聊下麽？</description>
		<content:encoded><![CDATA[<p>大哥啊，你在线？能否给我说说 变量的意义，我看懂了类80%的东西，还差点就能用了 我QQ：492902285  方便聊下麽？</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 雪候鸟</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-344</link>
		<dc:creator>雪候鸟</dc:creator>
		<pubDate>Fri, 14 Nov 2008 07:56:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-344</guid>
		<description>hi, 变量名的命名都是根据变量的实际意义来的，应该不难理解，；）</description>
		<content:encoded><![CDATA[<p>hi, 变量名的命名都是根据变量的实际意义来的，应该不难理解，；）</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 无名</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-339</link>
		<dc:creator>无名</dc:creator>
		<pubDate>Fri, 14 Nov 2008 06:57:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-339</guid>
		<description>很多变量看不懂什么含义，一个方法这么多变量，不是很难用麽？还忘作者能吧各个变量什么意思，说明白。</description>
		<content:encoded><![CDATA[<p>很多变量看不懂什么含义，一个方法这么多变量，不是很难用麽？还忘作者能吧各个变量什么意思，说明白。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-293</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 10 Nov 2008 12:27:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-293</guid>
		<description>感觉只用做成render的一个插件函数就搞定, 这样调用过于麻烦</description>
		<content:encoded><![CDATA[<p>感觉只用做成render的一个插件函数就搞定, 这样调用过于麻烦</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 雪候鸟</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-276</link>
		<dc:creator>雪候鸟</dc:creator>
		<pubDate>Wed, 05 Nov 2008 12:22:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-276</guid>
		<description>呵呵,good boy.</description>
		<content:encoded><![CDATA[<p>呵呵,good boy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jimmy</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-274</link>
		<dc:creator>jimmy</dc:creator>
		<pubDate>Tue, 04 Nov 2008 07:16:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-274</guid>
		<description>虽然我也大都不能理解这些文字，但我还是要来的..．（决不是有意给本blog抹黑）</description>
		<content:encoded><![CDATA[<p>虽然我也大都不能理解这些文字，但我还是要来的..．（决不是有意给本blog抹黑）</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ayiaman</title>
		<link>http://www.laruence.com/2008/10/28/567.html/comment-page-1#comment-273</link>
		<dc:creator>ayiaman</dc:creator>
		<pubDate>Mon, 03 Nov 2008 13:41:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.laruence.com/?p=567#comment-273</guid>
		<description>没必要什么扩展什么的，规范个格式，输入是$nowPage,$totalPage.
输出就是一个有10个数字点击的分页。。</description>
		<content:encoded><![CDATA[<p>没必要什么扩展什么的，规范个格式，输入是$nowPage,$totalPage.<br />
输出就是一个有10个数字点击的分页。。</p>
]]></content:encoded>
	</item>
</channel>
</rss>

