Hello,
I wanted to post this now 1 week or so but i am very busy and didn't had
time to write a proper email. I don't have enough now :( but still
trying to participate.
I already posted some time - in various forums/list - ago this problems
raised by working on big sites (with complex views). And problems are
far more complicated, basically the entire Controller, Action, View side
of ZF is not designed for some "real" sites.
The best structure i used before ZF was this way:
1. One database (could be .xml based better) with page entires
2. Each page is having at View side an index, a layout, and multiple zones.
Index is the top structure, each application can have multiple indexes,
but most have just one. Samples: main index, index for a popup window
which displays an image, aso.
An index has associated ONE layout which means the same "frame" (index)
can on content side have different structure. Each index has insertion
point for layout.
Each layout has associated ONE OR MORE zone files, each zone would
display content from a diff data source. Each layout has insertion
points for zones
Online shop sample:
- for an online shop the left side of the main layout can have a zone
where on different pages are displayed different things. But layout is
the same, just zones to be bound are different. Sample: main page having
on that zone list of all new products; a product details page having
into zone list of all related products aso.
3. Each zone is having a controller which is responsible for preparing
data for that zone
Steps for working with model:
a) The bootstrapper is identifying current page then is query-ing
database of pages requesting info about that page (index, layout, zones,
title page, aso, basically any custom info can be added).
b) All zone controllers are called so the all data is ready
c) Proper index is rendered, and on insertion point on index file is
rendered layout for that page. Again, at insertion points for zone on
that layout are rendered proper zones (specific for each page)
So, this model is far more appropriate for big sites and i worked with
this model a lot. I spent lot of time trying to reach something similar
on ZF, and had to rewrite lot of stuffs and is big mess... I simply
think the way is made Controller, Action, View side of ZF is not
appropriate for working on some real sites.
Any developer who tries to jump with ZF in this situations is going to
have a nightmare. Personally i don't know why are needed Controllers and
Actions in current format, aso.
I don't wanna sound like criticism, is just my experience working on
some real - production - stuff.
--
Best regards,
Cristian Bichis
www.zftutorials.com | www.zfforums.com | www.zflinks.com