<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Loading models within modules in the Zend Framework</title>
	<atom:link href="http://blog.fedecarg.com/2008/08/12/loading-models-within-modules-in-the-zend-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fedecarg.com/2008/08/12/loading-models-within-modules-in-the-zend-framework/</link>
	<description>Simple is better than complex. Complex is better than complicated. &#124; @fedecarg</description>
	<lastBuildDate>Mon, 06 Feb 2012 14:38:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Top Posts 2008</title>
		<link>http://blog.fedecarg.com/2008/08/12/loading-models-within-modules-in-the-zend-framework/#comment-2076</link>
		<dc:creator><![CDATA[Top Posts 2008]]></dc:creator>
		<pubDate>Sat, 10 Jan 2009 15:14:13 +0000</pubDate>
		<guid isPermaLink="false">http://phpimpact.wordpress.com/?p=598#comment-2076</guid>
		<description><![CDATA[[...] Loading models within modules in the Zend Framework [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Loading models within modules in the Zend Framework [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jopr</title>
		<link>http://blog.fedecarg.com/2008/08/12/loading-models-within-modules-in-the-zend-framework/#comment-1797</link>
		<dc:creator><![CDATA[jopr]]></dc:creator>
		<pubDate>Thu, 09 Oct 2008 11:24:10 +0000</pubDate>
		<guid isPermaLink="false">http://phpimpact.wordpress.com/?p=598#comment-1797</guid>
		<description><![CDATA[Interesting!

I was just looking around to see if I could find any modules to use with my Zend app... :-)

I have a app.ini similar to:

[bind]
acl.class = &quot;LdapAcl&quot;
acl.rdn = &quot;dc=example, dc=com&quot;
...
blog.class = &quot;BlogModel&quot;
blog.config = &quot;blog.ini&quot;

... and a controller plugin that (lazy-)populates a globally accessible model (Zend_Registry). Helpers in
both Controller and View provide access to the same
model so...

$this-&gt;getModel(&#039;blog&#039;)-&gt;get($this-&gt;getContext(&#039;blog.cur&#039;)
... will always give the same object.

Extending this with modules could give:

$this-&gt;getModel(&#039;blog:entry&#039;)-&gt;get($this-&gt;getContext(&#039;blog:entry.cur&#039;)

... providing seamless access between modules.

Erh... remembering some old python stuff i just miss the compact...

]]></description>
		<content:encoded><![CDATA[<p>Interesting!</p>
<p>I was just looking around to see if I could find any modules to use with my Zend app&#8230; :-)</p>
<p>I have a app.ini similar to:</p>
<p>[bind]<br />
acl.class = &#8220;LdapAcl&#8221;<br />
acl.rdn = &#8220;dc=example, dc=com&#8221;<br />
&#8230;<br />
blog.class = &#8220;BlogModel&#8221;<br />
blog.config = &#8220;blog.ini&#8221;</p>
<p>&#8230; and a controller plugin that (lazy-)populates a globally accessible model (Zend_Registry). Helpers in<br />
both Controller and View provide access to the same<br />
model so&#8230;</p>
<p>$this-&gt;getModel(&#8216;blog&#8217;)-&gt;get($this-&gt;getContext(&#8216;blog.cur&#8217;)<br />
&#8230; will always give the same object.</p>
<p>Extending this with modules could give:</p>
<p>$this-&gt;getModel(&#8216;blog:entry&#8217;)-&gt;get($this-&gt;getContext(&#8216;blog:entry.cur&#8217;)</p>
<p>&#8230; providing seamless access between modules.</p>
<p>Erh&#8230; remembering some old python stuff i just miss the compact&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Federico</title>
		<link>http://blog.fedecarg.com/2008/08/12/loading-models-within-modules-in-the-zend-framework/#comment-1401</link>
		<dc:creator><![CDATA[Federico]]></dc:creator>
		<pubDate>Thu, 28 Aug 2008 21:13:19 +0000</pubDate>
		<guid isPermaLink="false">http://phpimpact.wordpress.com/?p=598#comment-1401</guid>
		<description><![CDATA[You are right, thanks pejotr. I was using  Zend_Loader::loadClass() instead of Zend_Loader::loadFile(), and the first one replaces the underscores with a directory separator. There&#039;s no need to pass the name of the class now, just the filename. 

Example:

$model = $this-&gt;getModel(&#039;IndexModel&#039;);
$sharedModel = $this-&gt;getModel(&#039;PostsModel&#039;, &#039;blog&#039;);]]></description>
		<content:encoded><![CDATA[<p>You are right, thanks pejotr. I was using  Zend_Loader::loadClass() instead of Zend_Loader::loadFile(), and the first one replaces the underscores with a directory separator. There&#8217;s no need to pass the name of the class now, just the filename. </p>
<p>Example:</p>
<p>$model = $this-&gt;getModel(&#8216;IndexModel&#8217;);<br />
$sharedModel = $this-&gt;getModel(&#8216;PostsModel&#8217;, &#8216;blog&#8217;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pejotr</title>
		<link>http://blog.fedecarg.com/2008/08/12/loading-models-within-modules-in-the-zend-framework/#comment-1398</link>
		<dc:creator><![CDATA[pejotr]]></dc:creator>
		<pubDate>Thu, 28 Aug 2008 19:48:06 +0000</pubDate>
		<guid isPermaLink="false">http://phpimpact.wordpress.com/?p=598#comment-1398</guid>
		<description><![CDATA[I&#039;m not sure I&#039;m right but loading model with:
$sharedModel = $this-&gt;getModel(&#039;Blog_PostsModel&#039;, &#039;blog&#039;);
will load /appilication/blog/models/Blog/PostsModel.php, is that what you wanted to achieve ?]]></description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure I&#8217;m right but loading model with:<br />
$sharedModel = $this-&gt;getModel(&#8216;Blog_PostsModel&#8217;, &#8216;blog&#8217;);<br />
will load /appilication/blog/models/Blog/PostsModel.php, is that what you wanted to achieve ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: pejotr.log</title>
		<link>http://blog.fedecarg.com/2008/08/12/loading-models-within-modules-in-the-zend-framework/#comment-1387</link>
		<dc:creator><![CDATA[pejotr.log]]></dc:creator>
		<pubDate>Wed, 27 Aug 2008 12:26:10 +0000</pubDate>
		<guid isPermaLink="false">http://phpimpact.wordpress.com/?p=598#comment-1387</guid>
		<description><![CDATA[[...] Dwa rozwiązania tego problemu, jako helper i rozszerzenie Zend_Controller_Action, przedstawione są tu [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Dwa rozwiązania tego problemu, jako helper i rozszerzenie Zend_Controller_Action, przedstawione są tu [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuado -StR- Rodríguez</title>
		<link>http://blog.fedecarg.com/2008/08/12/loading-models-within-modules-in-the-zend-framework/#comment-1372</link>
		<dc:creator><![CDATA[Stuado -StR- Rodríguez]]></dc:creator>
		<pubDate>Sun, 24 Aug 2008 06:05:57 +0000</pubDate>
		<guid isPermaLink="false">http://phpimpact.wordpress.com/?p=598#comment-1372</guid>
		<description><![CDATA[the way i have been working is, after creating a front controller helper and extending the dispatcher, my modules follow the pear convention using a vendor and a module.
 for example:
Vendor_Module
Vendor_Module_Controller
etc...
i already have
Devel_Blog:
Devel_Blog_Article
Devel_Blog_Article_Comment
Devel_Blog_Controller_Article
Devel_Blog_Controller_Index
Devel_Blog_Admin_Controller_Index

Devel_Cms:
Devel_Cms_Page
Devel_Cms_Controller_Index
etc....

what i mean is that I add the vendor and module namespace (hoping i can port this to php 5.3).  even my db table names use the vendor_module convention, also my Zend_Session_Namespace follows the Vendor_Module convention...  

I tried to add you to my gtalk contacts, so we can discuss this further]]></description>
		<content:encoded><![CDATA[<p>the way i have been working is, after creating a front controller helper and extending the dispatcher, my modules follow the pear convention using a vendor and a module.<br />
 for example:<br />
Vendor_Module<br />
Vendor_Module_Controller<br />
etc&#8230;<br />
i already have<br />
Devel_Blog:<br />
Devel_Blog_Article<br />
Devel_Blog_Article_Comment<br />
Devel_Blog_Controller_Article<br />
Devel_Blog_Controller_Index<br />
Devel_Blog_Admin_Controller_Index</p>
<p>Devel_Cms:<br />
Devel_Cms_Page<br />
Devel_Cms_Controller_Index<br />
etc&#8230;.</p>
<p>what i mean is that I add the vendor and module namespace (hoping i can port this to php 5.3).  even my db table names use the vendor_module convention, also my Zend_Session_Namespace follows the Vendor_Module convention&#8230;  </p>
<p>I tried to add you to my gtalk contacts, so we can discuss this further</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim Fountain</title>
		<link>http://blog.fedecarg.com/2008/08/12/loading-models-within-modules-in-the-zend-framework/#comment-1294</link>
		<dc:creator><![CDATA[Tim Fountain]]></dc:creator>
		<pubDate>Fri, 15 Aug 2008 19:00:02 +0000</pubDate>
		<guid isPermaLink="false">http://phpimpact.wordpress.com/?p=598#comment-1294</guid>
		<description><![CDATA[I use a controller plugin to manipulate the include path in order to load module-specific models. I&#039;ve just stuck up some example code in case anyone is interested - http://www.tfountain.co.uk/blog/2008/8/15/zend-framework-module-models/

I like the idea of a Zend_Module_* set of components as a way to organise modules into packages that could be dropped into other apps. I think routing is the problem here though. 

One thing I like about the routing implementation in ZF is that it is flexible enough to allow routes to be defined in a number of different ways depending on coder preference and application needs. But in order for this whole thing to work, there would need to be a standard way for modules to define routes so that the application could load them.

Your Zend_Module example class allows definition of a routes &#039;directory&#039; - so would this contain a routes.ini file containing the module&#039;s routes? Or did you have something else in mind?]]></description>
		<content:encoded><![CDATA[<p>I use a controller plugin to manipulate the include path in order to load module-specific models. I&#8217;ve just stuck up some example code in case anyone is interested &#8211; <a href="http://www.tfountain.co.uk/blog/2008/8/15/zend-framework-module-models/" rel="nofollow">http://www.tfountain.co.uk/blog/2008/8/15/zend-framework-module-models/</a></p>
<p>I like the idea of a Zend_Module_* set of components as a way to organise modules into packages that could be dropped into other apps. I think routing is the problem here though. </p>
<p>One thing I like about the routing implementation in ZF is that it is flexible enough to allow routes to be defined in a number of different ways depending on coder preference and application needs. But in order for this whole thing to work, there would need to be a standard way for modules to define routes so that the application could load them.</p>
<p>Your Zend_Module example class allows definition of a routes &#8216;directory&#8217; &#8211; so would this contain a routes.ini file containing the module&#8217;s routes? Or did you have something else in mind?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Federico</title>
		<link>http://blog.fedecarg.com/2008/08/12/loading-models-within-modules-in-the-zend-framework/#comment-1277</link>
		<dc:creator><![CDATA[Federico]]></dc:creator>
		<pubDate>Wed, 13 Aug 2008 23:07:04 +0000</pubDate>
		<guid isPermaLink="false">http://phpimpact.wordpress.com/?p=598#comment-1277</guid>
		<description><![CDATA[@Bradley: I agree with what you said, modules have a huge potential. I think the problem is that, at the moment, it&#039;s difficult to extend the functionality of the front controller. For example, the addModuleDirectory() method doesn&#039;t store the value of the path to the modules. So if you want to get the path to the modules, you can&#039;t, there&#039;s no getModuleDirectory() method. 

Update: I&#039;ve created a Zend_Controller_Directory proposal that addresses this issue. ]]></description>
		<content:encoded><![CDATA[<p>@Bradley: I agree with what you said, modules have a huge potential. I think the problem is that, at the moment, it&#8217;s difficult to extend the functionality of the front controller. For example, the addModuleDirectory() method doesn&#8217;t store the value of the path to the modules. So if you want to get the path to the modules, you can&#8217;t, there&#8217;s no getModuleDirectory() method. </p>
<p>Update: I&#8217;ve created a Zend_Controller_Directory proposal that addresses this issue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Laurent Melmoux</title>
		<link>http://blog.fedecarg.com/2008/08/12/loading-models-within-modules-in-the-zend-framework/#comment-1273</link>
		<dc:creator><![CDATA[Laurent Melmoux]]></dc:creator>
		<pubDate>Wed, 13 Aug 2008 16:35:58 +0000</pubDate>
		<guid isPermaLink="false">http://phpimpact.wordpress.com/?p=598#comment-1273</guid>
		<description><![CDATA[Right now I ‘m using something like this to load my module models:

$model = Mmx_Loader::loadModel(‘Modulename_Modelname’);

It will be great to see some clear best practices on to setup Zend Framework modules. But I think it will need a hire level framework (Zend Application Framework foe ex.) because all those modules will have to share some component: same bootstrap, db,  auth, acl, log, error controller …]]></description>
		<content:encoded><![CDATA[<p>Right now I ‘m using something like this to load my module models:</p>
<p>$model = Mmx_Loader::loadModel(‘Modulename_Modelname’);</p>
<p>It will be great to see some clear best practices on to setup Zend Framework modules. But I think it will need a hire level framework (Zend Application Framework foe ex.) because all those modules will have to share some component: same bootstrap, db,  auth, acl, log, error controller …</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MonkeyT</title>
		<link>http://blog.fedecarg.com/2008/08/12/loading-models-within-modules-in-the-zend-framework/#comment-1272</link>
		<dc:creator><![CDATA[MonkeyT]]></dc:creator>
		<pubDate>Wed, 13 Aug 2008 16:00:24 +0000</pubDate>
		<guid isPermaLink="false">http://phpimpact.wordpress.com/?p=598#comment-1272</guid>
		<description><![CDATA[I think you&#039;re definitely on the right track here.  I think this would simplify making truly encapsulated modules AS WELL AS making the Front Controller simpler to explain and work with to those unfamiliar with it.]]></description>
		<content:encoded><![CDATA[<p>I think you&#8217;re definitely on the right track here.  I think this would simplify making truly encapsulated modules AS WELL AS making the Front Controller simpler to explain and work with to those unfamiliar with it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

