<?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: CakePHP 1.2 Pagination Note</title>
	<atom:link href="http://blog.awpny.com/2008/04/cakephp-12-pagination-note/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.awpny.com/2008/04/cakephp-12-pagination-note/</link>
	<description>"The frog can show you how to grow by making intelligent use of whatever opportunity is available." - medicine wheel</description>
	<lastBuildDate>Mon, 01 Feb 2010 14:52:19 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: ludolphus</title>
		<link>http://blog.awpny.com/2008/04/cakephp-12-pagination-note/comment-page-1/#comment-28724</link>
		<dc:creator>ludolphus</dc:creator>
		<pubDate>Wed, 23 Dec 2009 20:50:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.ancientwisdompro.com/blog/?p=251#comment-28724</guid>
		<description>quote: &quot;The generated sort link would always have the sort direction set to ‘asc’. Is this a bug?&quot; 

No it is not, you can actually change the default sort direction to &#039;asc&#039; or &#039;desc&#039; as follows:

force cakephp (using version 1.2.5) sort direction to &#039;DESC&#039;:

echo $paginator-&gt;sort(&#039;Rating&#039;, &#039;rating&#039;, array(&#039;url&#039; =&gt; array(&#039;direction&#039; =&gt; &#039;desc&#039;))).&#039; &#124; &#039;;

or flip it in your view yourself for a column:

$directionCreated = &#039;desc&#039;;
if ($paginator-&gt;sortKey(&#039;Modelname&#039;) == &#039;Modelname.created&#039;) {
	if ($paginator-&gt;sortDir(&#039;Modelname&#039;) == &#039;desc&#039; ) {
		$directionCreated = &#039;asc&#039;;
	}
}

echo $paginator-&gt;sort(&#039;Datum&#039;, &#039;created&#039;, array(&#039;url&#039; =&gt; array(&#039;direction&#039; =&gt; $directionCreated)));

This is actually documented in the CakePHP documentation: http://book.cakephp.org/view/656/Methods but not really clear that you can use it like this.

regards,
 Steve</description>
		<content:encoded><![CDATA[<p>quote: &#8220;The generated sort link would always have the sort direction set to ‘asc’. Is this a bug?&#8221; </p>
<p>No it is not, you can actually change the default sort direction to &#8216;asc&#8217; or &#8216;desc&#8217; as follows:</p>
<p>force cakephp (using version 1.2.5) sort direction to &#8216;DESC&#8217;:</p>
<p>echo $paginator-&gt;sort(&#8217;Rating&#8217;, &#8216;rating&#8217;, array(&#8217;url&#8217; =&gt; array(&#8217;direction&#8217; =&gt; &#8216;desc&#8217;))).&#8217; | &#8216;;</p>
<p>or flip it in your view yourself for a column:</p>
<p>$directionCreated = &#8216;desc&#8217;;<br />
if ($paginator-&gt;sortKey(&#8217;Modelname&#8217;) == &#8216;Modelname.created&#8217;) {<br />
	if ($paginator-&gt;sortDir(&#8217;Modelname&#8217;) == &#8216;desc&#8217; ) {<br />
		$directionCreated = &#8216;asc&#8217;;<br />
	}<br />
}</p>
<p>echo $paginator-&gt;sort(&#8217;Datum&#8217;, &#8216;created&#8217;, array(&#8217;url&#8217; =&gt; array(&#8217;direction&#8217; =&gt; $directionCreated)));</p>
<p>This is actually documented in the CakePHP documentation: <a href="http://book.cakephp.org/view/656/Methods" rel="nofollow">http://book.cakephp.org/view/656/Methods</a> but not really clear that you can use it like this.</p>
<p>regards,<br />
 Steve</p>
]]></content:encoded>
	</item>
</channel>
</rss>
