<?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>My Science Is Better &#187; zf modules</title>
	<atom:link href="http://www.myscienceisbetter.info/tag/zf-modules/feed" rel="self" type="application/rss+xml" />
	<link>http://www.myscienceisbetter.info</link>
	<description></description>
	<lastBuildDate>Sat, 20 Mar 2010 16:16:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Setup controllers and actions inside a module using zf tool</title>
		<link>http://www.myscienceisbetter.info/working-with-zf-tool-modules-controllers-and-actions.html</link>
		<comments>http://www.myscienceisbetter.info/working-with-zf-tool-modules-controllers-and-actions.html#comments</comments>
		<pubDate>Sat, 19 Dec 2009 17:19:25 +0000</pubDate>
		<dc:creator>Romeo Adrian Cioaba</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[zend framework]]></category>
		<category><![CDATA[zf modules]]></category>
		<category><![CDATA[zf tool]]></category>

		<guid isPermaLink="false">http://www.myscienceisbetter.info/?p=115</guid>
		<description><![CDATA[I've been trying to move some old code into separate modules for easier use later on. I installed zend framework and zend tool and created a new project:
zf create project myproject
Adding a new module is easy as pie:
zf create module mymodule
This creates the /application/modules/mymodule folder with complete MVC structure inside (controllers, models and views folders).
My [...]]]></description>
			<content:encoded><![CDATA[<p>I've been trying to move some old code into separate modules for easier use later on. I <a title="Install Zend Framework and Zend_Tool using PEAR on Ubuntu" href="http://www.myscienceisbetter.info/install-zend-framework-and-zend_tool-using-pear-on-ubuntu.html">installed zend framework and zend tool</a> and created a new project:</p>
<pre class="brush: bash;">zf create project myproject</pre>
<p>Adding a new module is easy as pie:</p>
<pre class="brush: bash;">zf create module mymodule</pre>
<p>This creates the /application/modules/mymodule folder with complete MVC structure inside (controllers, models and views folders).</p>
<p>My module was not working so after a bit of looking around i've found <a href="http://akrabat.com/zend-framework/bootstrapping-modules-in-zf-1-8/">Akrabat's post</a> that some light on the subject. You have to add to /application/configs.ini the following inside the [production] section:</p>
<pre class="brush: bash;">
# enabling modules
resources.frontController.moduleDirectory = APPLICATION_PATH &quot;/modules&quot;
resources.modules[] = &quot;&quot;
</pre>
<p>Good, now we should have a working module, except we don't have any controllers. Trying to create a controller proved a bit tricky as zf tool would not pleace them in the right place, inside the modules/mymodule/controllers but in the default /application/controllers. The same applies for actions. With a bit of help from TheAshMan on #zftalk i found the right answer:</p>
<pre class="brush: bash;">
# create controller Photos_IndexController at /application/modules/controllers/Photos_IndexController.php
zf create controller Photos_Index 1 mymodule
# create the action view inside the Photos_IndexController
zf create action view Photos_Index 1 mymodule
</pre>
<p>Hope this helps someone as it took me a few hours to figure it out <img src='http://www.myscienceisbetter.info/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.myscienceisbetter.info/working-with-zf-tool-modules-controllers-and-actions.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
