<?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: Fancy URLs with Inflector::slug</title>
	<atom:link href="http://cakealot.com/2009/01/fancy-urls-with-inflectorslug/feed/" rel="self" type="application/rss+xml" />
	<link>http://cakealot.com/2009/01/fancy-urls-with-inflectorslug/</link>
	<description>cakephp and stuff</description>
	<lastBuildDate>Fri, 27 Aug 2010 17:04:26 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Matt Huggins</title>
		<link>http://cakealot.com/2009/01/fancy-urls-with-inflectorslug/comment-page-1/#comment-195</link>
		<dc:creator>Matt Huggins</dc:creator>
		<pubDate>Fri, 18 Sep 2009 04:01:19 +0000</pubDate>
		<guid isPermaLink="false">http://cakealot.com/?p=113#comment-195</guid>
		<description>If the &#039;slug&#039; column is unique to your table, then you&#039;ll need to do something more like the following (pseudoCode):


function slugify($text) {
	$slug = low(Inflector::slug($text, &#039;-&#039;));
	$slugs = $this-&gt;find(&#039;all&#039;, array(
		&#039;fields&#039; =&gt; array(&#039;slug&#039;),
		&#039;conditions&#039; =&gt; array(&#039;slug LIKE&#039; =&gt; &#039;%&#039; . $slug),
	));
	if ($slugs) {
		$slugs = Set::extract($slugs, &quot;/{$this-&gt;alias}/slug&quot;);
		// loop through $slugs while incrementing $i to see if current($slugs) === &quot;$slug-$i&quot;, returning the new value of $slug when they&#039;re not equal.
	} else {
		return $slug;
	}
}
</description>
		<content:encoded><![CDATA[<p>If the &#8217;slug&#8217; column is unique to your table, then you&#8217;ll need to do something more like the following (pseudoCode):</p>
<p>function slugify($text) {<br />
	$slug = low(Inflector::slug($text, &#8216;-&#8217;));<br />
	$slugs = $this-&gt;find(&#8217;all&#8217;, array(<br />
		&#8216;fields&#8217; =&gt; array(&#8217;slug&#8217;),<br />
		&#8216;conditions&#8217; =&gt; array(&#8217;slug LIKE&#8217; =&gt; &#8216;%&#8217; . $slug),<br />
	));<br />
	if ($slugs) {<br />
		$slugs = Set::extract($slugs, &#8220;/{$this-&gt;alias}/slug&#8221;);<br />
		// loop through $slugs while incrementing $i to see if current($slugs) === &#8220;$slug-$i&#8221;, returning the new value of $slug when they&#8217;re not equal.<br />
	} else {<br />
		return $slug;<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VoiDeT</title>
		<link>http://cakealot.com/2009/01/fancy-urls-with-inflectorslug/comment-page-1/#comment-98</link>
		<dc:creator>VoiDeT</dc:creator>
		<pubDate>Mon, 06 Apr 2009 02:14:54 +0000</pubDate>
		<guid isPermaLink="false">http://cakealot.com/?p=113#comment-98</guid>
		<description>Thanks alot for this!
I didn&#039;t realise it could be so automagic :)
However i did have to include a return true; in the beforeSave call.
Also extended it to test if a custom slug has been included!

Thanks again!</description>
		<content:encoded><![CDATA[<p>Thanks alot for this!<br />
I didn&#8217;t realise it could be so automagic :)<br />
However i did have to include a return true; in the beforeSave call.<br />
Also extended it to test if a custom slug has been included!</p>
<p>Thanks again!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
