<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Typography &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/typography/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>Custom Routes with Zend_Controller_Router_Route</title>
		<link>/2010/04/20/custom-routes-with-zend_controller_router_route/</link>
		<comments>/2010/04/20/custom-routes-with-zend_controller_router_route/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 09:39:53 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[micro tutorial]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[Apache HTTP Server]]></category>
		<category><![CDATA[Bracket]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[Front Controller pattern]]></category>
		<category><![CDATA[index controller]]></category>
		<category><![CDATA[Latin alphabet]]></category>
		<category><![CDATA[PHP programming language]]></category>
		<category><![CDATA[Punctuation]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web application frameworks]]></category>
		<category><![CDATA[World Wide Web]]></category>

		<guid isPermaLink="false">/?p=1458</guid>
		<description><![CDATA[Rewrite The Url? Actually this is really a common task to do. You&#8217;ve to rewrite the url to be more &#8220;user friendly&#8221;. To be more clear I&#8217;ll give you an example. Let&#8217;s imagine you have a index controller and an index action. Thus if you have to load an Id from the database at least &#8230; <a href="/2010/04/20/custom-routes-with-zend_controller_router_route/" class="more-link">Continue reading <span class="screen-reader-text">Custom Routes with Zend_Controller_Router_Route</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2010/06/16/zend-examples-get-parameters-default-value/" rel="bookmark" title="Zend Examples: GET Parameters Default Value">Zend Examples: GET Parameters Default Value </a></li>
<li><a href="/2009/10/27/zend-framework-custom-urls/" rel="bookmark" title="Zend Framework custom URLs">Zend Framework custom URLs </a></li>
<li><a href="/2010/06/23/bind-zend-action-with-non-default-view-part-2/" rel="bookmark" title="Bind Zend Action with Non-Default View &#8211; Part 2">Bind Zend Action with Non-Default View &#8211; Part 2 </a></li>
<li><a href="/2009/12/20/redirecting-with-zend-framework-part-2/" rel="bookmark" title="Redirecting with Zend Framework &#8211; part 2">Redirecting with Zend Framework &#8211; part 2 </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Rewrite The Url?</h2>
<p>Actually this is really a common task to do. You&#8217;ve to rewrite the url to be more &#8220;user friendly&#8221;. To be more clear I&#8217;ll give you an example. Let&#8217;s imagine you have a index controller and an index action. Thus if you have to load an Id from the database at least with the build in <a title="Zend Framework" href="http://framework.zend.com/" target="_blank">Zend Framework</a> capabilities, you&#8217;ve to use this link:</p>
<pre>www.example.com/index/index/id/33949</pre>
<p>This is not good. It&#8217;s really bad. It will be great if you can use something like this:</p>
<pre>www.example.com/33949</pre>
<p>The solution in Zend Framework is called <a title="Zend_Controller_Router_Route" href="http://framework.zend.com/manual/en/zend.controller.router.html" target="_blank">Zend_Controller_Router_Route</a>. In a short snippet this will look like so:</p>
<pre lang="php" escaped="true">
$frontController-&gt;addRoute("my-route", new Zend_Controller_Router_Route("/:id",
    array("controller" =&gt; "index", "action" =&gt; "index", 'id' =&gt; 1),
    array('id' =&gt; '\d+')));
</pre>
<p>Here as you can see id is set to be 1. But don&#8217;t worry that&#8217;s not a hard code. The real work is done by the last parameter where the id is matched against a number value. Thus www.example.com/3 will be OK, but www.example.com/3a won&#8217;t.</p>
<h2>Important Note</h2>
<p>Don&#8217;t forget to add this rewrite rule in the .htaccess file.</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2010/06/16/zend-examples-get-parameters-default-value/" rel="bookmark" title="Zend Examples: GET Parameters Default Value">Zend Examples: GET Parameters Default Value </a></li>
<li><a href="/2009/10/27/zend-framework-custom-urls/" rel="bookmark" title="Zend Framework custom URLs">Zend Framework custom URLs </a></li>
<li><a href="/2010/06/23/bind-zend-action-with-non-default-view-part-2/" rel="bookmark" title="Bind Zend Action with Non-Default View &#8211; Part 2">Bind Zend Action with Non-Default View &#8211; Part 2 </a></li>
<li><a href="/2009/12/20/redirecting-with-zend-framework-part-2/" rel="bookmark" title="Redirecting with Zend Framework &#8211; part 2">Redirecting with Zend Framework &#8211; part 2 </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/04/20/custom-routes-with-zend_controller_router_route/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
