<?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: Custom CakePHP 1.2 Pagination Queries</title>
	<atom:link href="http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/</link>
	<description>Facebook should&#039;ve be written in unicornSchemaLang, because everyone *knows* that PHP is no good for anything, right?</description>
	<lastBuildDate>Mon, 09 Aug 2010 16:04:35 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Tagz &#124; &#34;@TheKeyboard &#187; Blog Archive &#187; Custom CakePHP 1.2 Pagination Queries&#34; &#124; Comments</title>
		<link>http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/comment-page-1/#comment-12055</link>
		<dc:creator>Tagz &#124; &#34;@TheKeyboard &#187; Blog Archive &#187; Custom CakePHP 1.2 Pagination Queries&#34; &#124; Comments</dc:creator>
		<pubDate>Sat, 16 May 2009 17:08:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/#comment-12055</guid>
		<description>[...]               [upmod] [downmod]     @TheKeyboard &#187; Blog Archive &#187; Custom CakePHP 1.2 Pagination Queries  (www.littlehart.net)    2 points posted 8 months, 3 weeks ago by jainaks2008  tags sql cake [...]</description>
		<content:encoded><![CDATA[<p>[...]               [upmod] [downmod]     @TheKeyboard &raquo; Blog Archive &raquo; Custom CakePHP 1.2 Pagination Queries  (www.littlehart.net)    2 points posted 8 months, 3 weeks ago by jainaks2008  tags sql cake [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/comment-page-1/#comment-11925</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Wed, 29 Apr 2009 16:01:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/#comment-11925</guid>
		<description>You&#039;re welcome - thanks for the tutorial!!!</description>
		<content:encoded><![CDATA[<p>You&#8217;re welcome &#8211; thanks for the tutorial!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Hartjes</title>
		<link>http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/comment-page-1/#comment-11923</link>
		<dc:creator>Chris Hartjes</dc:creator>
		<pubDate>Wed, 29 Apr 2009 14:55:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/#comment-11923</guid>
		<description>@Tim

Fixed the typo.  Thanks for pointing it out.</description>
		<content:encoded><![CDATA[<p>@Tim</p>
<p>Fixed the typo.  Thanks for pointing it out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/comment-page-1/#comment-11921</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Wed, 29 Apr 2009 14:52:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/#comment-11921</guid>
		<description>Please fix typo:
Change this:
&#039;fields&#039; = $fields,
To this:
&#039;fields&#039; =&gt; $fields,</description>
		<content:encoded><![CDATA[<p>Please fix typo:<br />
Change this:<br />
&#8216;fields&#8217; = $fields,<br />
To this:<br />
&#8216;fields&#8217; =&gt; $fields,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Hartjes</title>
		<link>http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/comment-page-1/#comment-11445</link>
		<dc:creator>Chris Hartjes</dc:creator>
		<pubDate>Fri, 27 Feb 2009 21:55:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/#comment-11445</guid>
		<description>@Tara

I&#039;ve never tried having more than one set of pagination links on a page so I don&#039;t know how to approach this.  Maybe something like requestAction pulling in info from three different views?</description>
		<content:encoded><![CDATA[<p>@Tara</p>
<p>I&#8217;ve never tried having more than one set of pagination links on a page so I don&#8217;t know how to approach this.  Maybe something like requestAction pulling in info from three different views?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tara Page</title>
		<link>http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/comment-page-1/#comment-11438</link>
		<dc:creator>Tara Page</dc:creator>
		<pubDate>Wed, 25 Feb 2009 21:20:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/#comment-11438</guid>
		<description>Any &#039;not so easy&#039; ways that you can think of :)  I have tried a few out and not having a lot of luck yet....</description>
		<content:encoded><![CDATA[<p>Any &#8216;not so easy&#8217; ways that you can think of <img src='http://www.littlehart.net/atthekeyboard/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   I have tried a few out and not having a lot of luck yet&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Hartjes</title>
		<link>http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/comment-page-1/#comment-11433</link>
		<dc:creator>Chris Hartjes</dc:creator>
		<pubDate>Mon, 23 Feb 2009 17:42:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/#comment-11433</guid>
		<description>@Tara

I don&#039;t know of any EASY way to accomplish what you&#039;re asking, as I&#039;ve only played around with one set of pagination links per page.</description>
		<content:encoded><![CDATA[<p>@Tara</p>
<p>I don&#8217;t know of any EASY way to accomplish what you&#8217;re asking, as I&#8217;ve only played around with one set of pagination links per page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tara Page</title>
		<link>http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/comment-page-1/#comment-11432</link>
		<dc:creator>Tara Page</dc:creator>
		<pubDate>Mon, 23 Feb 2009 17:36:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/#comment-11432</guid>
		<description>Hi,

I have to have one page that has 3 tables on it.  Each of the tables needs to be paginated, and they are ALL from the SAME model.  They are for Trades, so I&#039;m having 3 tables, one will show all trades in state open, the other for all trades in state closed, and the final all in pending state.

My question is, how can I call the paginate 3 different times in the same model?  I do:

    $this-&gt;set(&#039;trades1&#039;, $this-&gt;paginate(&#039;Trade&#039;, array(&#039;Trade.trading_state_id&#039;=&gt;&#039;open&#039;)));
    $this-&gt;set(&#039;trades2&#039;, $this-&gt;paginate(&#039;Trade&#039;, array(&#039;Trade.trading_state_id&#039;=&gt;&#039;closed&#039;)));
    $this-&gt;set(&#039;trades3&#039;, $this-&gt;paginate(&#039;Trade&#039;, array(&#039;Trade.trading_state_id&#039;=&gt;&#039;pending&#039;)));
  
Then when I render the screen, I use the appropriate data for the appropriate table. HOWEVER, all of the paging stats (next, previous, # of records) are all the data from the last paginate call of course...

I&#039;m using AJAX to render only the appropriate section, although I don&#039;t know where the user is coming from, it is re-rendering the entire screen (all 3 tables) in the desired output div instead of just the one.

In summary, how can you call paginate multiple times for the same model in your controller?  Also, is there a way of knowing where you came from (ie which table did you click next on) from your views?

Hope this makes sense.  Any help would be appreciated.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I have to have one page that has 3 tables on it.  Each of the tables needs to be paginated, and they are ALL from the SAME model.  They are for Trades, so I&#8217;m having 3 tables, one will show all trades in state open, the other for all trades in state closed, and the final all in pending state.</p>
<p>My question is, how can I call the paginate 3 different times in the same model?  I do:</p>
<p>    $this-&gt;set(&#8216;trades1&#8242;, $this-&gt;paginate(&#8216;Trade&#8217;, array(&#8216;Trade.trading_state_id&#8217;=&gt;&#8217;open&#8217;)));<br />
    $this-&gt;set(&#8216;trades2&#8242;, $this-&gt;paginate(&#8216;Trade&#8217;, array(&#8216;Trade.trading_state_id&#8217;=&gt;&#8217;closed&#8217;)));<br />
    $this-&gt;set(&#8216;trades3&#8242;, $this-&gt;paginate(&#8216;Trade&#8217;, array(&#8216;Trade.trading_state_id&#8217;=&gt;&#8217;pending&#8217;)));</p>
<p>Then when I render the screen, I use the appropriate data for the appropriate table. HOWEVER, all of the paging stats (next, previous, # of records) are all the data from the last paginate call of course&#8230;</p>
<p>I&#8217;m using AJAX to render only the appropriate section, although I don&#8217;t know where the user is coming from, it is re-rendering the entire screen (all 3 tables) in the desired output div instead of just the one.</p>
<p>In summary, how can you call paginate multiple times for the same model in your controller?  Also, is there a way of knowing where you came from (ie which table did you click next on) from your views?</p>
<p>Hope this makes sense.  Any help would be appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mark</title>
		<link>http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/comment-page-1/#comment-11331</link>
		<dc:creator>mark</dc:creator>
		<pubDate>Thu, 29 Jan 2009 04:40:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/#comment-11331</guid>
		<description>i had the same trouble Adam pointed out.

after hours of trying to get a special pagination to work without losing my normal pagination in this model, i came up with the following:

in your model.php, create a new class ModelExt extends Model {}
and inside this class insert the above 2 functions

now you can init. it and use this custom query pagination in your controller by passing this object into the pagination method:

$this-&gt;ModelExt = new ModelExt();
$res = $this-&gt;paginate($this-&gt;ModelExt);

as i said - hours of trying out every possible solution...</description>
		<content:encoded><![CDATA[<p>i had the same trouble Adam pointed out.</p>
<p>after hours of trying to get a special pagination to work without losing my normal pagination in this model, i came up with the following:</p>
<p>in your model.php, create a new class ModelExt extends Model {}<br />
and inside this class insert the above 2 functions</p>
<p>now you can init. it and use this custom query pagination in your controller by passing this object into the pagination method:</p>
<p>$this-&gt;ModelExt = new ModelExt();<br />
$res = $this-&gt;paginate($this-&gt;ModelExt);</p>
<p>as i said &#8211; hours of trying out every possible solution&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Luke</title>
		<link>http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/comment-page-1/#comment-11082</link>
		<dc:creator>Luke</dc:creator>
		<pubDate>Thu, 11 Dec 2008 20:36:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.littlehart.net/atthekeyboard/2008/03/04/custom-cakephp-12-pagination-queries/#comment-11082</guid>
		<description>Thanks for that code Radek, I was trying to figure out how to change the paginate var in a controller function (I have need for different pagination records per page in one controller). I find it funny that a lot of this info is not readily available in the Cakephp docs</description>
		<content:encoded><![CDATA[<p>Thanks for that code Radek, I was trying to figure out how to change the paginate var in a controller function (I have need for different pagination records per page in one controller). I find it funny that a lot of this info is not readily available in the Cakephp docs</p>
]]></content:encoded>
	</item>
</channel>
</rss>
