2009年3月9日星期一

Re: [fw-core] Sidebar + Common elements -- How to?

2009/3/9 Raavi Raaj <raaviraaj77@gmail.com>:
> Hi,
> 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)?

There are a few options for this I usually use the Action Stack,
though you can look at Action Helper, partials (performance hit),
switching layout scripts, View Helpers. Without more detail its hard
to say, if its just a static sidebar ie no data I would either use a
different layout or a View Helper (View helpers can access your Model
too remember).

> -------------------------------------
> 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?

View Helpers, this is what they are designed to do :)

> All help is appreciated.
> -R

--
----------------------------------------------------------------------
[MuTe]
----------------------------------------------------------------------

没有评论: