I like this approach. Seems really flexible.
A little guidance required here :)...
How do I set up the items in the extended view helper e.g. My_View_Helper_Placeholder
Sorry for my above question, I am still learning :)
-R
On Mon, Mar 9, 2009 at 5:52 PM, Matthew Weier O'Phinney <matthew@zend.com> wrote:
-- Raavi Raaj <raaviraaj77@gmail.com> wrote
(on Monday, 09 March 2009, 12:59 PM +0530):
Typically, I recommend using the placeholder() view helper to aggregate> I have 5 views which require a sidebar (out of 30 odd views). I have one layout
> script.
> The sidebar content is mostly the same (except for one block which is specific
> to the view)
>
> What is the best way to approach this (in ZF style, of course)?
>
> -------------------------------------
>
> Also, I have some HTML that I would like to include is the view based on some
> CRITERIA. For example...
> HTML = If you enjoyed this article. Do consider <a href="/rss" title="RSS 2.0
> feed">subscribing to our feed</a>
> CRITERIA = Search visitor
>
> Now, where should I store the HTML? What is the best prtactice for common
> elements like these?
>
> All help is appreciated.
content for sidebars.
If the majority of the content is the same for those views requiring the
information, I'd create a view helper extending the placeholder() view
helper that sets up these items. Then, in your individual action view
scripts, you would add your additional items to the placeholder (either
prepending or appending to the items already contained), and then render
it within that view script.
--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/
没有评论:
发表评论