I've had a similar discussion a couple of weeks ago with similar arguments
presented.

For our company I wanted to create a system where non-technical staff can
control how a website is composited. For that reason, I created a system
where navigation, ACL, URL's and pages (components/widgets and layout) are
all database driven.

The system now operates as follows:
- bootstrap loads ACL and site structure (navigation/pages) from database
(not directly, but through managers)
- a plugin is used that:
  - creates routes (routeStartup) using the structure manager
  - checks access to the requested page after routing
  - after (successful) dispatch of the 'main' component:
    - selects the proper layout
    - fills some placeholders with data from the database (title tag, meta
stuff)
    - loads all other components (allowed by the ACL) using
Zend_View_Helper_Action and puts the content in the layout

The database stores parameters to pass into the components and resource
names for each component. Management of the whole system is now web based.

I've noticed the perfomance hit on using Zend_View_Helper_Action, but don't
know what a better approach would be. When asked, the only answer I get is:
"Use view helpers!" but without further explanation or any argument aside
from the performance hit. What I described above seems to me to be to
large/complex for what a view helper is intended to. Sure, parts of this
system could be done in helpers, but controlling what goes on a page?

If performance is the major issue, that might weigh up against the
flexibility of such a system. It would be just a design choice and effort
should be taken to improve the dispatcher or create a lighter dispatcher for
'secondary' content. 

Thanks for reading this anyway!

Kind regards,

Vincent de Lau
 [email protected]



> -----Original Message-----
> From: keith Pope [mailto:[email protected]]
> Sent: Saturday, March 14, 2009 11:31 AM
> To: Dan Ballance
> Cc: [email protected]
> Subject: Re: [fw-general] routeShutdown firing before action stack ...?
> 
> You may want to read this blog
> 
> http://www.rmauger.co.uk/2009/03/why-the-zend-framework-actionstack-is-
> evil/
> 
> and the performance guide in the manual, generally it is suggested to
> use the placeholder view helper which gives you control over placement
> or your own view helper.
> 
> Hope that helps :)
> 
> 2009/3/14 Dan Ballance <[email protected]>:
> > Hi folks,
> >
> > I am trying to build a flexible 'widgetised' layout where the data
> for which
> > blocks go in which segments is held in the database.
> >
> > My current logic is to:
> >
> > read layout from the database and then load action stack with a
> > controller/action for each block
> > in my front controller plugin, on routeStartup, 'open bookend' each
> segment
> > with required markup
> > loop through the blocks found in the database and write each block
> output to
> > the correct segment with action stack
> > in my front controller plugin, on routeShutdown, 'close bookend' each
> > segment with necessary markup.
> > layout is finally renderred from the segments (top, left, default,
> right,
> > bottom) - where default is the output from the original
> controller/action
> > combo in the url
> >
> > The block data in the database tells me not just which
> controller/action
> > combo, but also the segment to write to. This is passed to action
> stack as a
> > param.
> >
> > I have created my own action controller which gets the segment param
> which
> > was passed to action stack and sets the segment to write the block to
> in
> > pre-dispatch.
> >
> > It's working reasonably well - except the end result is, for example
> with
> > the top segment:
> >
> > opening bookend, closing bookend, block 1, block 2, block 3
> >
> > What I want is:
> >
> > opening bookend, block 1, block 2, block 3, closing bookend
> >
> > I realise I haven't posted code yet ( can do that next, but didn't
> want to
> > post a huge message). At this stage i'm wondering if anyone can see a
> flaw
> > in my logic, am I misunderstanding the dispatch sequence?
> >
> > Any help / clues VERY gratefully received - i'm stuck!
> >
> > cheers,
> >
> > dan
> >
> >
> >
> 
> 
> 
> --
> ----------------------------------------------------------------------
> [MuTe]
> ----------------------------------------------------------------------

Reply via email to