<?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: Zend Framework View Notes</title>
	<atom:link href="http://benramsey.com/archives/zend-framework-view-notes/feed/" rel="self" type="application/rss+xml" />
	<link>http://benramsey.com/archives/zend-framework-view-notes/</link>
	<description>PHP and Other Techno-babble</description>
	<lastBuildDate>Mon, 01 Feb 2010 11:59:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: strip club list</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-278365</link>
		<dc:creator>strip club list</dc:creator>
		<pubDate>Tue, 24 Feb 2009 09:16:44 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-278365</guid>
		<description>This is in response to michaels comment...

&quot;initView() and render() are no longer required by default. You can have an empty conroller class and it will still work with the view file by default.&quot;

It&#039;s true that once an action function meets the end if no render() is called it will automatically render the template..however, it&#039;s still GOOD programming practice to include it. Personally I will always use it just to remind myself (and anyone else viewing the code) what to expect next.</description>
		<content:encoded><![CDATA[<p>This is in response to michaels comment&#8230;</p>
<p>&#8220;initView() and render() are no longer required by default. You can have an empty conroller class and it will still work with the view file by default.&#8221;</p>
<p>It&#8217;s true that once an action function meets the end if no render() is called it will automatically render the template..however, it&#8217;s still GOOD programming practice to include it. Personally I will always use it just to remind myself (and anyone else viewing the code) what to expect next.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rate pics</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-278364</link>
		<dc:creator>rate pics</dc:creator>
		<pubDate>Tue, 24 Feb 2009 09:14:09 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-278364</guid>
		<description>Personally I feel Zends default View is, lack of a better term, crap. I have incorporated Smarty into my ZF App and couldn&#039;t be more pleased!</description>
		<content:encoded><![CDATA[<p>Personally I feel Zends default View is, lack of a better term, crap. I have incorporated Smarty into my ZF App and couldn&#8217;t be more pleased!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit Shah</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-254334</link>
		<dc:creator>Amit Shah</dc:creator>
		<pubDate>Mon, 17 Nov 2008 09:23:56 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-254334</guid>
		<description>Fatal error: Uncaught exception &#039;Zend_Loader_PluginLoader_Exception&#039; with message &#039;Plugin by name GetViewSuffix was not found in the registry.&#039; in D:\Amit\phpprojects\flagship\library\Zend\Loader\PluginLoader.php:370 Stack trace: #0 D:\Amit\phpprojects\flagship\library\Zend\View\Abstract.php(1114): Zend_Loader_PluginLoader-&gt;load(&#039;GetViewSuffix&#039;) #1 D:\Amit\phpprojects\flagship\library\Zend\View\Abstract.php(545): Zend_View_Abstract-&gt;_getPlugin(&#039;helper&#039;, &#039;getViewSuffix&#039;) #2 D:\Amit\phpprojects\flagship\library\Zend\View\Abstract.php(312): Zend_View_Abstract-&gt;getHelper(&#039;getViewSuffix&#039;) #3 [internal function]: Zend_View_Abstract-&gt;__call(&#039;getViewSuffix&#039;, Array) #4 D:\Amit\phpprojects\flagship\library\GTL\Controller\Action.php(43): Zend_View-&gt;getViewSuffix() #5 D:\Amit\phpprojects\flagship\library\Zend\Controller\Action.php(118): GTL_Controller_Action-&gt;init() #6 D:\Amit\phpprojects\flagship\library\Zend\Controller\Dispatcher\Standard.php(261): Zend_Controller_Action-&gt;__construct(Object(Zend_Controller_Request_Http), Object(Zen in D:\Amit\phpprojects\flagship\library\Zend\Loader\PluginLoader.php on line 370

I&#039;m getting above error. Could you please explain me where is the problem?

Would be appreciated your help.</description>
		<content:encoded><![CDATA[<p>Fatal error: Uncaught exception &#8216;Zend_Loader_PluginLoader_Exception&#8217; with message &#8216;Plugin by name GetViewSuffix was not found in the registry.&#8217; in D:\Amit\phpprojects\flagship\library\Zend\Loader\PluginLoader.php:370 Stack trace: #0 D:\Amit\phpprojects\flagship\library\Zend\View\Abstract.php(1114): Zend_Loader_PluginLoader->load(&#8216;GetViewSuffix&#8217;) #1 D:\Amit\phpprojects\flagship\library\Zend\View\Abstract.php(545): Zend_View_Abstract-><em>getPlugin(&#8216;helper&#8217;, &#8216;getViewSuffix&#8217;) #2 D:\Amit\phpprojects\flagship\library\Zend\View\Abstract.php(312): Zend_View_Abstract->getHelper(&#8216;getViewSuffix&#8217;) #3 [internal function]: Zend_View_Abstract-></em><em>call(&#8216;getViewSuffix&#8217;, Array) #4 D:\Amit\phpprojects\flagship\library\GTL\Controller\Action.php(43): Zend_View->getViewSuffix() #5 D:\Amit\phpprojects\flagship\library\Zend\Controller\Action.php(118): GTL_Controller_Action->init() #6 D:\Amit\phpprojects\flagship\library\Zend\Controller\Dispatcher\Standard.php(261): Zend_Controller_Action-></em>_construct(Object(Zend_Controller_Request_Http), Object(Zen in D:\Amit\phpprojects\flagship\library\Zend\Loader\PluginLoader.php on line 370</p>
<p>I&#8217;m getting above error. Could you please explain me where is the problem?</p>
<p>Would be appreciated your help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-118316</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Fri, 01 Feb 2008 17:38:35 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-118316</guid>
		<description>initView() and render() are no longer required by default. You can have an empty conroller class and it will still work with the view file by default.</description>
		<content:encoded><![CDATA[<p>initView() and render() are no longer required by default. You can have an empty conroller class and it will still work with the view file by default.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amir Laher</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-31712</link>
		<dc:creator>Amir Laher</dc:creator>
		<pubDate>Mon, 07 May 2007 01:10:15 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-31712</guid>
		<description>Actually, I just re-read Sacha&#039;s post, and I think he&#039;s right - some actions do not need the view at all.

It&#039;s probably best just to use $this-&gt;initView() as &amp; when you need to. 

e.g.
&lt;code&gt;
...
function indexAction()
{
 $this-&gt;initView();
 $this-&gt;view-&gt;assign ( &#039;a&#039; , &#039;b&#039; );
 $this-&gt;render();
}
...
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Actually, I just re-read Sacha&#8217;s post, and I think he&#8217;s right &#8211; some actions do not need the view at all.</p>
<p>It&#8217;s probably best just to use $this->initView() as &#038; when you need to. </p>
<p>e.g.<br />
<code><br />
...<br />
function indexAction()<br />
{</code></p>
<p> $this->initView();<br />
 $this->view->assign ( &#8216;a&#8217; , &#8216;b&#8217; );<br />
 $this->render();<br />
}<br />
...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amir Laher</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-31708</link>
		<dc:creator>Amir Laher</dc:creator>
		<pubDate>Mon, 07 May 2007 01:04:46 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-31708</guid>
		<description>Good article, thanks. 

Hopefully this will get covered in the manual soon. It seems to be most pertinent to the Model part of MVC, which doesn&#039;t have its own manual section. Maybe that&#039;s why it&#039;s not there yet.

Just to clarify, $this-&gt;initView() needs to be called before you can assign data to the view.

If you hadn&#039;t initialized the view, the following action would throw a fatal error (for attempting to call a method on a non-object $this-&gt;view):
&lt;code&gt;
function indexAction() 
{
    $this-&gt;view-&gt;assign ( &#039;a&#039; , &#039;b&#039; );
    $this-&gt;render();
}
&lt;/code&gt;

I would favour creating an abstract class which extends Zend_Controller_Action, and defining the init() method in this class (as Ben has done in the concrete controller): all your controllers can then just inherit your abstract class, and you won&#039;t need to worry about initView() any more.

I wonder if they&#039;ll alter Zend_Controller_Action to do this by default for us ... 

Cheers, Amir</description>
		<content:encoded><![CDATA[<p>Good article, thanks. </p>
<p>Hopefully this will get covered in the manual soon. It seems to be most pertinent to the Model part of MVC, which doesn&#8217;t have its own manual section. Maybe that&#8217;s why it&#8217;s not there yet.</p>
<p>Just to clarify, $this->initView() needs to be called before you can assign data to the view.</p>
<p>If you hadn&#8217;t initialized the view, the following action would throw a fatal error (for attempting to call a method on a non-object $this->view):<br />
<code><br />
function indexAction() <br />
{</code></p>
<p>    $this->view->assign ( &#8216;a&#8217; , &#8216;b&#8217; );<br />
    $this->render();<br />
}</p>
<p>I would favour creating an abstract class which extends Zend_Controller_Action, and defining the init() method in this class (as Ben has done in the concrete controller): all your controllers can then just inherit your abstract class, and you won&#8217;t need to worry about initView() any more.</p>
<p>I wonder if they&#8217;ll alter Zend_Controller_Action to do this by default for us &#8230; </p>
<p>Cheers, Amir</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trying to set up i5 with Framework - Zend Framework Forum</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-30943</link>
		<dc:creator>Trying to set up i5 with Framework - Zend Framework Forum</dc:creator>
		<pubDate>Wed, 02 May 2007 23:11:41 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-30943</guid>
		<description>[...] Originally Posted by chris_hird   I have set up the php.ini to see the /www/shieldcrm/application in searches. This allows me to include files in the config simply by using config/DB_config.php etc... However I still have to set the scriptpaths etc to the full path ie /www/shieldcrm/application/controllers etc...  How can I set the scriptpaths to be linked to a partial url?  Chris...    Actually now Zend_View will automatically render views from the views folder in a setup described here: Ben Ramsey » Blog Archive » Zend Framework View Notes  As for setScriptPath(), you can use get_include_path() for the path of the views or do something similar to this   PHP Code:    $appDir&#160;=&#160;Zend_Registry::getInstance()-&gt;get(&#039;applicationDirectory&#039;);&#160;$this-&gt;setScriptPath($appDir&#160;.&#160;DIRECTORY_SEPARATOR&#160;.&#160;$request-&gt;getModuleName()&#160;.&#160;&#039;/Views&#039;);&#160;          __________________ SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home [...]</description>
		<content:encoded><![CDATA[<p>[...] Originally Posted by chris_hird   I have set up the php.ini to see the /www/shieldcrm/application in searches. This allows me to include files in the config simply by using config/DB_config.php etc&#8230; However I still have to set the scriptpaths etc to the full path ie /www/shieldcrm/application/controllers etc&#8230;  How can I set the scriptpaths to be linked to a partial url?  Chris&#8230;    Actually now Zend_View will automatically render views from the views folder in a setup described here: Ben Ramsey » Blog Archive » Zend Framework View Notes  As for setScriptPath(), you can use get_include_path() for the path of the views or do something similar to this   PHP Code:    $appDir&nbsp;=&nbsp;Zend_Registry::getInstance()->get(&#8216;applicationDirectory&#8217;);&nbsp;$this->setScriptPath($appDir&nbsp;.&nbsp;DIRECTORY_SEPARATOR&nbsp;.&nbsp;$request->getModuleName()&nbsp;.&nbsp;&#8217;/Views&#8217;);&nbsp;          <i><em></em></i><i></i><i><em></em></i>__ SpotSec Network Gateway Project on SourceForge SpotSec Network Gateway Project Home [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek Martin</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-27106</link>
		<dc:creator>Derek Martin</dc:creator>
		<pubDate>Thu, 19 Apr 2007 02:04:36 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-27106</guid>
		<description>I&#039;m all for auto-rendering. Great idea. If only it had been implemented as gracefully as in RubyOnRails... 

Having to call initView() is clumsy. Having -&gt;render() echo instead of return is also asking for trouble (it means you have to output-buffer in order to nest templates).

.phtml isn&#039;t always enabled, so you&#039;re cutting out people on some shared-hosts. Stick to standards.

I also dislike having a pointless &#039;scripts&#039; directory. It&#039;s just one more thing I have to drill-down into[sigh]. Furthermore, it&#039;s anti-semantic! The name &#039;scripts&#039; directly contradicts one of the main reasons for using the .phtml extension -- to make it easy to distinguish between &#039;scripts&#039; and &#039;views&#039;. Putting non-script views in a scripts directory is nonsensical.

Of course, these are all critiques of the View object, and not your writing, Ben. Very handy &amp; well-written tutorial.</description>
		<content:encoded><![CDATA[<p>I&#8217;m all for auto-rendering. Great idea. If only it had been implemented as gracefully as in RubyOnRails&#8230; </p>
<p>Having to call initView() is clumsy. Having ->render() echo instead of return is also asking for trouble (it means you have to output-buffer in order to nest templates).</p>
<p>.phtml isn&#8217;t always enabled, so you&#8217;re cutting out people on some shared-hosts. Stick to standards.</p>
<p>I also dislike having a pointless &#8216;scripts&#8217; directory. It&#8217;s just one more thing I have to drill-down into[sigh]. Furthermore, it&#8217;s anti-semantic! The name &#8216;scripts&#8217; directly contradicts one of the main reasons for using the .phtml extension&#8212;to make it easy to distinguish between &#8216;scripts&#8217; and &#8216;views&#8217;. Putting non-script views in a scripts directory is nonsensical.</p>
<p>Of course, these are all critiques of the View object, and not your writing, Ben. Very handy &#038; well-written tutorial.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: corpotec</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-24481</link>
		<dc:creator>corpotec</dc:creator>
		<pubDate>Fri, 06 Apr 2007 19:00:19 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-24481</guid>
		<description>Great, Thank you for your great info on Zend. Will be back soon, as i am new to Zend. 
Many thanks once again.</description>
		<content:encoded><![CDATA[<p>Great, Thank you for your great info on Zend. Will be back soon, as i am new to Zend. <br />
Many thanks once again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stuart</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-24090</link>
		<dc:creator>Stuart</dc:creator>
		<pubDate>Thu, 05 Apr 2007 19:02:47 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-24090</guid>
		<description>If you want to see rigid, try using a framework like Cake or Symfony (or Rails). I like Zend&#039;s efforts because they are so much more flexible than what else is out there.</description>
		<content:encoded><![CDATA[<p>If you want to see rigid, try using a framework like Cake or Symfony (or Rails). I like Zend&#8217;s efforts because they are so much more flexible than what else is out there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Ramsey</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-24051</link>
		<dc:creator>Ben Ramsey</dc:creator>
		<pubDate>Thu, 05 Apr 2007 15:05:47 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-24051</guid>
		<description>Alex:

Please note that I said this is the &quot;default&quot; behavior. You are allowed to customize and extend things as much as you want, so you are not locked into a rigid way of doing things. You can also specify a different location for your views or even a different named view than that of your action. It&#039;s very flexible; what I&#039;ve discussed in this post is not the only way to do things.</description>
		<content:encoded><![CDATA[<p>Alex:</p>
<p>Please note that I said this is the &#8220;default&#8221; behavior. You are allowed to customize and extend things as much as you want, so you are not locked into a rigid way of doing things. You can also specify a different location for your views or even a different named view than that of your action. It&#8217;s very flexible; what I&#8217;ve discussed in this post is not the only way to do things.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sascha Goebel</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-24042</link>
		<dc:creator>Sascha Goebel</dc:creator>
		<pubDate>Thu, 05 Apr 2007 14:29:30 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-24042</guid>
		<description>Hi Ben,

you don&#039;t have to call $this-&gt;initView(); explicitly in your init method as the Zend_Controller_Action::render method does this automatically for you.

This way you can skip the instantiation in cases where you redirect or output via other mechanisms :-)

Happy hacking,
Sascha</description>
		<content:encoded><![CDATA[<p>Hi Ben,</p>
<p>you don&#8217;t have to call $this->initView(); explicitly in your init method as the Zend_Controller_Action::render method does this automatically for you.</p>
<p>This way you can skip the instantiation in cases where you redirect or output via other mechanisms <img src='http://benramsey.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Happy hacking,<br />
Sascha</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Newton Wagner &#187; Arquivo &#187; Mais Zend Framework</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-24037</link>
		<dc:creator>Newton Wagner &#187; Arquivo &#187; Mais Zend Framework</dc:creator>
		<pubDate>Thu, 05 Apr 2007 14:27:01 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-24037</guid>
		<description>[...] Zend Framework View Notes: Uma boa maneira de trabalhar com Views; [...]</description>
		<content:encoded><![CDATA[<p>[...] Zend Framework View Notes: Uma boa maneira de trabalhar com Views; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Mikitik</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-24024</link>
		<dc:creator>Alex Mikitik</dc:creator>
		<pubDate>Thu, 05 Apr 2007 13:20:24 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-24024</guid>
		<description>Does anyone else find the amount of setup rigid and tedious?

I&#039;ve always liked the Velocity-like nature of the Zend View (and others), but it seems that way too much code was tacked on to reduce the amount of work/discipline on developer&#039;s part.

This seems like an awefully strict structure to impose in the name of organization...one that would quickly breakdown if a need arose outside of what View was designed for.</description>
		<content:encoded><![CDATA[<p>Does anyone else find the amount of setup rigid and tedious?</p>
<p>I&#8217;ve always liked the Velocity-like nature of the Zend View (and others), but it seems that way too much code was tacked on to reduce the amount of work/discipline on developer&#8217;s part.</p>
<p>This seems like an awefully strict structure to impose in the name of organization&#8230;one that would quickly breakdown if a need arose outside of what View was designed for.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Ramsey</title>
		<link>http://benramsey.com/archives/zend-framework-view-notes/comment-page-1/#comment-24023</link>
		<dc:creator>Ben Ramsey</dc:creator>
		<pubDate>Thu, 05 Apr 2007 13:15:37 +0000</pubDate>
		<guid isPermaLink="false">http://benramsey.com/archives/zend-framework-view-notes/#comment-24023</guid>
		<description>Andries:

While the wiki manual may be more up to date, the &lt;a href=&quot;http://framework.zend.com/wiki/display/ZFDOCDEV/34.+Zend_View&quot; rel=&quot;nofollow&quot;&gt;Zend_View section&lt;/a&gt; still does not explain what I described in this post. Instead, it continues to illustrate the use of views by instantiating a new Zend_View object, specifying the location of the views directory for it, and echoing a call to &lt;code&gt;$view-&gt;render()&lt;/code&gt;.</description>
		<content:encoded><![CDATA[<p>Andries:</p>
<p>While the wiki manual may be more up to date, the <a href="http://framework.zend.com/wiki/display/ZFDOCDEV/34.+Zend_View" rel="nofollow">Zend_View section</a> still does not explain what I described in this post. Instead, it continues to illustrate the use of views by instantiating a new Zend_View object, specifying the location of the views directory for it, and echoing a call to <code>$view->render()</code>.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
