<?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>Franzens.nu &#187; Zend Framework</title>
	<atom:link href="http://franzens.nu/category/datorer/php/zend-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://franzens.nu</link>
	<description>Familjens Franzéns blogg</description>
	<lastBuildDate>Tue, 22 May 2012 15:23:17 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>The quest of routing in Zend Framework</title>
		<link>http://franzens.nu/2008/09/09/the-quest-of-routing-in-zend-framework/</link>
		<comments>http://franzens.nu/2008/09/09/the-quest-of-routing-in-zend-framework/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 19:45:44 +0000</pubDate>
		<dc:creator>Erik Franzén</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://franzens.nu/?p=178</guid>
		<description><![CDATA[I am a ZF beginner and I am trying to find out a way to handle routing. Let say that I am building a website with different sections: http://example.com/news http://example.com/articles http://example.com/gallery http://example.com/forum I am wondering how should I set up routing? Take the forum as an example. Let say I use this principle: http://example.com/module/controller/action?var1=value&#38;var2=value And [...]]]></description>
			<content:encoded><![CDATA[<p>I am a ZF beginner and I am trying to find out a way to handle routing.</p>
<p>Let say that I am building a website with different sections:</p>
<p>http://example.com/news<br />
http://example.com/articles <br />
http://example.com/gallery<br />
http://example.com/forum</p>
<p>I am wondering how should I set up routing? Take the forum as an example.</p>
<p>Let say I use this principle:</p>
<p>http://example.com/module/controller/action?var1=value&amp;var2=value</p>
<p>And apply the principle to the forums function addpost:</p>
<p>&quot;http://example.com/forum/addpost&quot; should be routed to Forum module, viewthread Action, indexAction() method</p>
<p>The indexAction method displays a form where you can write your post. The forms action is pointing to http://example.com/forum/addpost/add<br />
&nbsp;which is represented by the addAction() method in the same controller.</p>
<p>By choosing module/controller/action route pattern, each controller manages a complete &quot;forum function&quot; like:</p>
<ul>
<li>Adding a post (writing, preview, adding post)</li>
<li>Editing a post (writing, preview, update post)</li>
<li>Reading a post (display)</li>
</ul>
<p>This looks like a good solution for me? But is it working?</p>
<p>And how can you handle a form which has several submit buttons in the above context? I must point the forms action to a *Action method in the Controller and inside this method I must handle which button the user has pressed and do a second &quot;dispatch&quot; on my own? I would like to have organized code, with one method per &quot;subfunction&quot;. Has ZF built in functions for this?</p>
<p>/Erik</p>

]]></content:encoded>
			<wfw:commentRss>http://franzens.nu/2008/09/09/the-quest-of-routing-in-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Staplande steg med Zend Framework</title>
		<link>http://franzens.nu/2008/09/07/177/</link>
		<comments>http://franzens.nu/2008/09/07/177/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 19:26:12 +0000</pubDate>
		<dc:creator>Erik Franzén</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://franzens.nu/?p=177</guid>
		<description><![CDATA[Har i dagarna f&#229;tt lite smak p&#229; att koda lite. Har k&#246;pt en bok, PHP&#124;architect&#8217;s guide to Programming with Zend Framework. Mycket intressant l&#228;sning som g&#246;r mig grymt nyfiken. Dock verkar tr&#246;skeln vara h&#246;g f&#246;r att kunna anv&#228;nda Framworket eftersom i alla fall jag&#160; vill veta hur det funkar i detalj. H&#229;ller just nu p&#229; [...]]]></description>
			<content:encoded><![CDATA[<p>Har i dagarna f&aring;tt lite smak p&aring; att koda lite. Har k&ouml;pt en bok, PHP|architect&#8217;s guide to Programming with Zend Framework. Mycket intressant l&auml;sning som g&ouml;r mig grymt nyfiken. Dock verkar tr&ouml;skeln vara h&ouml;g f&ouml;r att kunna anv&auml;nda Framworket eftersom i alla fall jag&nbsp; vill veta hur det funkar i detalj.</p>
<p>H&aring;ller just nu p&aring; f&ouml;rst&aring; hur routing sker. Zend Framework bygger p&aring; principen att alla request hamnar i en enda php-fil, mha mod rewrite om man k&ouml;r apache. Zend Framework anv&auml;nder en sk FrontController f&ouml;r att expedera (dispatch) alla anrop till individuella sk Action Controllers.</p>
<p>I denna process ing&aring;r routing och det &auml;r den som jag just nu studerar. Vill luska ut hur Zend Framwork&nbsp; routar f&ouml;ljande exempel:</p>
<p>http://examplecom/forum/viewboard/board/ot</p>
<p>Detta enligt principen http://example.com/controller/action/var/value</p>
<p>Ovanst&aring;ende &auml;r standard routing-inst&auml;llningar i Zend Framework och skulle i s&aring; fall routa anropet till classen Forum och metoden viewboardAction.</p>
<p>Dock inser jag att klassen Forum skulle bli gigantiskt stor eftersom den skulle beh&ouml;va inneh&aring;ll alla Action-metoder som ett forum kr&auml;ver. Det blir m&aring;nga, vilket betyder att man m&aring;ste g&ouml;ra refactoring p&aring; n&aring;got b&auml;ttre s&auml;tt. Hur detta skall g&ouml;ras har jag inte &auml;nnu lyckats klurat ut.</p>
<p>/Erik</p>
<p>&nbsp;</p>

]]></content:encoded>
			<wfw:commentRss>http://franzens.nu/2008/09/07/177/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

