<?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: Per Module Zend_Layout</title>
	<atom:link href="http://dustint.com/post/28/per-module-zend_layout/feed" rel="self" type="application/rss+xml" />
	<link>http://dustint.com/post/28/per-module-zend_layout</link>
	<description>Tales Of A (Former) SFU Computing Scientist</description>
	<lastBuildDate>Fri, 09 Dec 2011 02:20:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Rafael</title>
		<link>http://dustint.com/post/28/per-module-zend_layout/comment-page-1#comment-661</link>
		<dc:creator>Rafael</dc:creator>
		<pubDate>Sat, 21 May 2011 21:44:29 +0000</pubDate>
		<guid isPermaLink="false">http://dustint.com/?p=28#comment-661</guid>
		<description>Thanks! 
This was very helpful to me.</description>
		<content:encoded><![CDATA[<p>Thanks!<br />
This was very helpful to me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bazmo</title>
		<link>http://dustint.com/post/28/per-module-zend_layout/comment-page-1#comment-516</link>
		<dc:creator>Bazmo</dc:creator>
		<pubDate>Thu, 10 Feb 2011 00:21:51 +0000</pubDate>
		<guid isPermaLink="false">http://dustint.com/?p=28#comment-516</guid>
		<description>Hi,

I&#039;ve just done a very similar plugin as this myself, however I made it invoke the postDispatch function. I&#039;m curious if there is any need for it to be in pre/post. I&#039;m guessing pre would be better as this then allows the controller to change it if it needs, in the action.

One more issue I&#039;m having is now that I&#039;ve changed my layout path, my partials in my default layout path aren&#039;t working. 

Cheers,

Baz</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I&#8217;ve just done a very similar plugin as this myself, however I made it invoke the postDispatch function. I&#8217;m curious if there is any need for it to be in pre/post. I&#8217;m guessing pre would be better as this then allows the controller to change it if it needs, in the action.</p>
<p>One more issue I&#8217;m having is now that I&#8217;ve changed my layout path, my partials in my default layout path aren&#8217;t working. </p>
<p>Cheers,</p>
<p>Baz</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rad</title>
		<link>http://dustint.com/post/28/per-module-zend_layout/comment-page-1#comment-411</link>
		<dc:creator>rad</dc:creator>
		<pubDate>Tue, 07 Dec 2010 23:54:48 +0000</pubDate>
		<guid isPermaLink="false">http://dustint.com/?p=28#comment-411</guid>
		<description>Alternatively you can setup the module specific layout  directory in you custom action controller:

abstract class App_Controller_Action
	extends Zend_Controller_Action
{

	/**
	 * Returnns current module directory
	 *
	 * @return string
	 */
	protected function getCurrentModuleDirectory() {
		return Zend_Controller_Front::getInstance()-&gt;getModuleDirectory(
				$this-&gt;getRequest()-&gt;getModuleName());
	}

	public function preDispatch(){
		parent::preDispatch();
		Zend_Layout::getMvcInstance()-&gt;setLayoutPath(
				$this-&gt;getCurrentModuleDirectory() . &#039;/layouts/scripts&#039;);
	}
}</description>
		<content:encoded><![CDATA[<p>Alternatively you can setup the module specific layout  directory in you custom action controller:</p>
<p>abstract class App_Controller_Action<br />
	extends Zend_Controller_Action<br />
{</p>
<p>	/**<br />
	 * Returnns current module directory<br />
	 *<br />
	 * @return string<br />
	 */<br />
	protected function getCurrentModuleDirectory() {<br />
		return Zend_Controller_Front::getInstance()-&gt;getModuleDirectory(<br />
				$this-&gt;getRequest()-&gt;getModuleName());<br />
	}</p>
<p>	public function preDispatch(){<br />
		parent::preDispatch();<br />
		Zend_Layout::getMvcInstance()-&gt;setLayoutPath(<br />
				$this-&gt;getCurrentModuleDirectory() . &#8216;/layouts/scripts&#8217;);<br />
	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: patrickburke.de &#124; Blog</title>
		<link>http://dustint.com/post/28/per-module-zend_layout/comment-page-1#comment-338</link>
		<dc:creator>patrickburke.de &#124; Blog</dc:creator>
		<pubDate>Sun, 05 Sep 2010 16:05:07 +0000</pubDate>
		<guid isPermaLink="false">http://dustint.com/?p=28#comment-338</guid>
		<description>[...] kurze Google Suche ergab, dass man sich einfach ein Front Controller Plugin schreiben kann, das vor dem Dispatchen abhängig [...]</description>
		<content:encoded><![CDATA[<p>[...] kurze Google Suche ergab, dass man sich einfach ein Front Controller Plugin schreiben kann, das vor dem Dispatchen abhängig [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Seif</title>
		<link>http://dustint.com/post/28/per-module-zend_layout/comment-page-1#comment-324</link>
		<dc:creator>Seif</dc:creator>
		<pubDate>Fri, 23 Jul 2010 22:50:39 +0000</pubDate>
		<guid isPermaLink="false">http://dustint.com/?p=28#comment-324</guid>
		<description>well , it&#039;s a very clean , perfect and easy solution
I was searching all the day and this is the best solution
Thank you</description>
		<content:encoded><![CDATA[<p>well , it&#8217;s a very clean , perfect and easy solution<br />
I was searching all the day and this is the best solution<br />
Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dustin</title>
		<link>http://dustint.com/post/28/per-module-zend_layout/comment-page-1#comment-276</link>
		<dc:creator>Dustin</dc:creator>
		<pubDate>Sun, 23 May 2010 06:31:03 +0000</pubDate>
		<guid isPermaLink="false">http://dustint.com/?p=28#comment-276</guid>
		<description>&lt;blockquote cite=&quot;#commentbody-275&quot;&gt;
&lt;strong&gt;&lt;a href=&quot;#comment-275&quot; rel=&quot;nofollow&quot;&gt;behrang&lt;/a&gt; :&lt;/strong&gt;
          &lt;p&gt;Hi. I am newbie to Zend Framework I really need this but my problem is unfortunately I don’t know where to put the above code please explain actually path and file name.&lt;/p&gt;
         &lt;/blockquote&gt;
Now that there is the Zend_application Component, the plugin registration should be done in the Bootstrap Class File. The actual plugin file should be placed somewhere where the Autoloader will find it, or it can be directly required using require_once. 

For more info, please see the Zend Framework documentation at http://framework.zend.com/manual/en/zend.controller.plugins.html

I haven&#039;t tried this code on the newer versions of Zend. can anyone confirm its working?</description>
		<content:encoded><![CDATA[<blockquote cite="#commentbody-275"><p>
<strong><a href="#comment-275" rel="nofollow">behrang</a> :</strong></p>
<p>Hi. I am newbie to Zend Framework I really need this but my problem is unfortunately I don’t know where to put the above code please explain actually path and file name.</p>
</blockquote>
<p>Now that there is the Zend_application Component, the plugin registration should be done in the Bootstrap Class File. The actual plugin file should be placed somewhere where the Autoloader will find it, or it can be directly required using require_once. </p>
<p>For more info, please see the Zend Framework documentation at <a href="http://framework.zend.com/manual/en/zend.controller.plugins.html" rel="nofollow">http://framework.zend.com/manual/en/zend.controller.plugins.html</a></p>
<p>I haven&#8217;t tried this code on the newer versions of Zend. can anyone confirm its working?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: behrang</title>
		<link>http://dustint.com/post/28/per-module-zend_layout/comment-page-1#comment-275</link>
		<dc:creator>behrang</dc:creator>
		<pubDate>Sun, 23 May 2010 05:04:54 +0000</pubDate>
		<guid isPermaLink="false">http://dustint.com/?p=28#comment-275</guid>
		<description>Hi. I am newbie to Zend Framework I really need this but my problem is unfortunately I don&#039;t know where to put the above code please explain actually path and file name.</description>
		<content:encoded><![CDATA[<p>Hi. I am newbie to Zend Framework I really need this but my problem is unfortunately I don&#8217;t know where to put the above code please explain actually path and file name.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DA</title>
		<link>http://dustint.com/post/28/per-module-zend_layout/comment-page-1#comment-179</link>
		<dc:creator>DA</dc:creator>
		<pubDate>Mon, 19 Oct 2009 09:20:41 +0000</pubDate>
		<guid isPermaLink="false">http://dustint.com/?p=28#comment-179</guid>
		<description>I did the following:

created a LayoutPlugin.php in the modules folder.
included that into the public/index.php
/setup the layout
Zend_Layout::startMvc(array(
‘layoutPath’ =&gt; APPLICATION_PATH . ‘modules/default/layouts/scripts’,
‘layout’ =&gt; ‘layout’
));

$layoutModulePlugin = new Module_LayoutPlugin();
$layoutModulePlugin-&gt;registerModuleLayout(’admin’,’../application/admin/layouts’);

$controller-&gt;registerPlugin($layoutModulePlugin);

and it keeps giving me an error

Fatal error: Class &#039;Zend_Controller_Front&#039; not found in C:\wamp\www\project\public\index.php on line 20</description>
		<content:encoded><![CDATA[<p>I did the following:</p>
<p>created a LayoutPlugin.php in the modules folder.<br />
included that into the public/index.php<br />
/setup the layout<br />
Zend_Layout::startMvc(array(<br />
‘layoutPath’ =&gt; APPLICATION_PATH . ‘modules/default/layouts/scripts’,<br />
‘layout’ =&gt; ‘layout’<br />
));</p>
<p>$layoutModulePlugin = new Module_LayoutPlugin();<br />
$layoutModulePlugin-&gt;registerModuleLayout(’admin’,’../application/admin/layouts’);</p>
<p>$controller-&gt;registerPlugin($layoutModulePlugin);</p>
<p>and it keeps giving me an error</p>
<p>Fatal error: Class &#8216;Zend_Controller_Front&#8217; not found in C:\wamp\www\project\public\index.php on line 20</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EM</title>
		<link>http://dustint.com/post/28/per-module-zend_layout/comment-page-1#comment-174</link>
		<dc:creator>EM</dc:creator>
		<pubDate>Mon, 05 Oct 2009 21:07:09 +0000</pubDate>
		<guid isPermaLink="false">http://dustint.com/?p=28#comment-174</guid>
		<description>Thanks - it was easy to follow.</description>
		<content:encoded><![CDATA[<p>Thanks &#8211; it was easy to follow.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Deitrich Zook</title>
		<link>http://dustint.com/post/28/per-module-zend_layout/comment-page-1#comment-110</link>
		<dc:creator>Deitrich Zook</dc:creator>
		<pubDate>Wed, 16 Sep 2009 04:08:45 +0000</pubDate>
		<guid isPermaLink="false">http://dustint.com/?p=28#comment-110</guid>
		<description>Thanks for showing the short simple way and the more extensive way using individual layouts for various modules.   I am going to use the simple way for the time being as I only have one controller in the new module that needs a custom layout.  

For anyone wanting an example based on this one, there is an example here:
http://www.zfforums.com/zend-framework-components-13/model-view-controller-mvc-21/disable-layout-entire-module-1723.html</description>
		<content:encoded><![CDATA[<p>Thanks for showing the short simple way and the more extensive way using individual layouts for various modules.   I am going to use the simple way for the time being as I only have one controller in the new module that needs a custom layout.  </p>
<p>For anyone wanting an example based on this one, there is an example here:<br />
<a href="http://www.zfforums.com/zend-framework-components-13/model-view-controller-mvc-21/disable-layout-entire-module-1723.html" rel="nofollow">http://www.zfforums.com/zend-framework-components-13/model-view-controller-mvc-21/disable-layout-entire-module-1723.html</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

