<?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: PHP URL Routing (PUR)</title>
	<atom:link href="http://josephscott.org/archives/2008/11/php-url-routing-pur/feed/" rel="self" type="application/rss+xml" />
	<link>http://josephscott.org/archives/2008/11/php-url-routing-pur/</link>
	<description></description>
	<lastBuildDate>Thu, 11 Mar 2010 06:54:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Alan&#8217;s blog &#187; What&#8217;s wrong with dynamic binding?</title>
		<link>http://josephscott.org/archives/2008/11/php-url-routing-pur/#comment-7659</link>
		<dc:creator>Alan&#8217;s blog &#187; What&#8217;s wrong with dynamic binding?</dc:creator>
		<pubDate>Mon, 20 Jul 2009 20:12:25 +0000</pubDate>
		<guid isPermaLink="false">http://josephscott.org/?p=309#comment-7659</guid>
		<description>[...] on mobile-based programming tools. [back]Similar to the pattern proposed by Joseph Scott in &#8220;PHP URL Routing (PUR)&#8220; [back]e.g. Gantenbein, R. E. and Jones, D. W. 1986. Dynamic binding of separately compiled [...]</description>
		<content:encoded><![CDATA[<p>[...] on mobile-based programming tools. [back]Similar to the pattern proposed by Joseph Scott in &#8220;PHP URL Routing (PUR)&#8220; [back]e.g. Gantenbein, R. E. and Jones, D. W. 1986. Dynamic binding of separately compiled [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Martin Stancik</title>
		<link>http://josephscott.org/archives/2008/11/php-url-routing-pur/#comment-5052</link>
		<dc:creator>Martin Stancik</dc:creator>
		<pubDate>Thu, 14 May 2009 23:17:51 +0000</pubDate>
		<guid isPermaLink="false">http://josephscott.org/?p=309#comment-5052</guid>
		<description>Hi Scott,

thanks for this nice code. As I needed more case insensitive and more flexible mapping, I have some suggestions:

1/to enable case insensitive mapping, 
a/ modify (line 12) in INDEX.PHP into
$route-&gt;routeURL( strtolower(preg_replace( &quot;&#124;/$&#124;&quot;, &quot;&quot;, $_GET[&#039;_route_&#039;] ) ) );

b/ then use always lower case for mapping for the $routes

2/ to better regexp mapping support,
a) change in class PUR delimiters for eg ` (as regxp symvol &#124; is used to indicate OR),
  preg_match( &quot;`{$path}`i&quot;, $url, $match );
b) skip cropping of last character /, modifing the route call
  $route-&gt;routeURL( strtolower( $_GET[&#039;_route_&#039;] ) );

3) I am comming from a Python World, I wanted controlers like in Webpy (see http://webpy.org), So I have defined additionaly:

class Webpy {
	function request($args = false) {
		if (empty($_POST)) {
			$this-&gt;GET($args);

		} else {
			$this-&gt;POST($args);
		}

	} // function request

	function GET($args=false) {
		echo &quot;Exception: GET() not defined in
		 (class: &quot;.$_GET[&quot;_route_&quot;].&quot; file: &quot;.$_SERVER[&#039;PHP_SELF&#039;].&quot;)&quot;;
	}

	function POST($args=false) {
		echo &quot;Exception: POST() not defined in
		 (class: &quot;.$_GET[&quot;_route_&quot;].&quot; file: &quot;.$_SERVER[&#039;PHP_SELF&#039;].&quot;)&quot;;
	}

} // class Webpy

class DEMO extends Webpy {

function GET($args=false) { }
function POST($args=false) { }
}

$routes = ...
   &#039;^article/year/(\d{4}/\d+)$&#039; =&gt; array(&quot;DEM0&quot;, &quot;request&quot;)
...
example: http://localhost/article/year/2009/2345</description>
		<content:encoded><![CDATA[<p>Hi Scott,</p>
<p>thanks for this nice code. As I needed more case insensitive and more flexible mapping, I have some suggestions:</p>
<p>1/to enable case insensitive mapping,<br />
a/ modify (line 12) in INDEX.PHP into<br />
$route-&gt;routeURL( strtolower(preg_replace( &#8220;|/$|&#8221;, &#8220;&#8221;, $_GET['_route_'] ) ) );</p>
<p>b/ then use always lower case for mapping for the $routes</p>
<p>2/ to better regexp mapping support,<br />
a) change in class PUR delimiters for eg ` (as regxp symvol | is used to indicate OR),<br />
  preg_match( &#8220;`{$path}`i&#8221;, $url, $match );<br />
b) skip cropping of last character /, modifing the route call<br />
  $route-&gt;routeURL( strtolower( $_GET['_route_'] ) );</p>
<p>3) I am comming from a Python World, I wanted controlers like in Webpy (see <a href="http://webpy.org)" rel="nofollow">http://webpy.org)</a>, So I have defined additionaly:</p>
<p>class Webpy {<br />
	function request($args = false) {<br />
		if (empty($_POST)) {<br />
			$this-&gt;GET($args);</p>
<p>		} else {<br />
			$this-&gt;POST($args);<br />
		}</p>
<p>	} // function request</p>
<p>	function GET($args=false) {<br />
		echo &#8220;Exception: GET() not defined in<br />
		 (class: &#8220;.$_GET["_route_"].&#8221; file: &#8220;.$_SERVER['PHP_SELF'].&#8221;)&#8221;;<br />
	}</p>
<p>	function POST($args=false) {<br />
		echo &#8220;Exception: POST() not defined in<br />
		 (class: &#8220;.$_GET["_route_"].&#8221; file: &#8220;.$_SERVER['PHP_SELF'].&#8221;)&#8221;;<br />
	}</p>
<p>} // class Webpy</p>
<p>class DEMO extends Webpy {</p>
<p>function GET($args=false) { }<br />
function POST($args=false) { }<br />
}</p>
<p>$routes = &#8230;<br />
   &#8216;^article/year/(\d{4}/\d+)$&#8217; =&gt; array(&#8220;DEM0&#8243;, &#8220;request&#8221;)<br />
&#8230;<br />
example: <a href="http://localhost/article/year/2009/2345" rel="nofollow">http://localhost/article/year/2009/2345</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: builder2 links for 2009/04/18 &#124; builder2</title>
		<link>http://josephscott.org/archives/2008/11/php-url-routing-pur/#comment-3963</link>
		<dc:creator>builder2 links for 2009/04/18 &#124; builder2</dc:creator>
		<pubDate>Wed, 22 Apr 2009 19:50:48 +0000</pubDate>
		<guid isPermaLink="false">http://josephscott.org/?p=309#comment-3963</guid>
		<description>[...] PHP URL Routing (PUR)     marketing [...]</description>
		<content:encoded><![CDATA[<p>[...] PHP URL Routing (PUR)     marketing [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scream</title>
		<link>http://josephscott.org/archives/2008/11/php-url-routing-pur/#comment-1066</link>
		<dc:creator>Scream</dc:creator>
		<pubDate>Mon, 19 Jan 2009 18:45:42 +0000</pubDate>
		<guid isPermaLink="false">http://josephscott.org/?p=309#comment-1066</guid>
		<description>Thanks
My problem was that the .htaccess file was not in the base dir. Now it works fine :)</description>
		<content:encoded><![CDATA[<p>Thanks<br />
My problem was that the .htaccess file was not in the base dir. Now it works fine :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joseph Scott</title>
		<link>http://josephscott.org/archives/2008/11/php-url-routing-pur/#comment-1063</link>
		<dc:creator>Joseph Scott</dc:creator>
		<pubDate>Mon, 19 Jan 2009 18:35:35 +0000</pubDate>
		<guid isPermaLink="false">http://josephscott.org/?p=309#comment-1063</guid>
		<description>There are examples of how to use this in the post.</description>
		<content:encoded><![CDATA[<p>There are examples of how to use this in the post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scream</title>
		<link>http://josephscott.org/archives/2008/11/php-url-routing-pur/#comment-1062</link>
		<dc:creator>Scream</dc:creator>
		<pubDate>Mon, 19 Jan 2009 17:47:01 +0000</pubDate>
		<guid isPermaLink="false">http://josephscott.org/?p=309#comment-1062</guid>
		<description>can you provide sample files?
because I didn&#039;t work for me, although I have activated mod_rewrite in my apache server

greetings from France</description>
		<content:encoded><![CDATA[<p>can you provide sample files?<br />
because I didn&#8217;t work for me, although I have activated mod_rewrite in my apache server</p>
<p>greetings from France</p>
]]></content:encoded>
	</item>
</channel>
</rss>