-- 7eicher <[EMAIL PROTECTED]> wrote
(on Tuesday, 16 October 2007, 03:42 AM -0700):
>
> I like to reduce cost of reinstancating the front controller again and again,
> but how can i handle a call like the following with the dispatch loop
> proposal:
>
> # content.phtml
> <div id="reportX">
> <?php echo $this->widgetUri("reports/grid/users/page/3"); ?>
> </div>
>
> in the action 'users' of controller 'grid' i would handle the parameter
> 'page' and the value 3 to return the the third page of the grid. the problem
> with the dispatchloop in this example would be, how to pass the param to the
> action without manipulating the orignal request object. another use case
> would be to modifiy the request http header which can be existential in some
> special cases.
You should take a look at Zend_View_Helper_Action in the incubator, as
it solves this problem already.
> in other words, if i would not use a front controller chain, i have to use a
> request chain to have allways the right request object in place, for example
> in the controller, view and where else. you have any ideas to implement a
> request chain? maybe this could help improving performance dramaticaly.
>
> markus
>
>
> Matthew Weier O'Phinney-3 wrote:
> >
> > -- 7eicher <[EMAIL PROTECTED]> wrote
> > (on Monday, 15 October 2007, 02:17 AM -0700):
> >> in my current project i built up a widget system based on ZF which
> >> allowes
> >> to run a front controller twice or more during runtime and getting the
> >> response of a so called subrequest in a view with:
> >>
> >> <div id="calendar">
> >> <?php echo $this->widget("calendar", "utils", "global-module"); ?>
> >> </div>
> >>
> >> This post is for those who are interested in chaining the front
> >> controller
> >> object and getting allways the right instance when calling
> >> Zend_Controller_Front::getInstance().
> >>
> >> The Problem with current Zend_Controller_Front is, that it implements the
> >> singelton pattern and it allways give the current instance back. that
> >> means,
> >> its not possible to have more than one instance at the same time. of
> >> course,
> >> this behavior is neccessary for the helperbrooker, but this is another
> >> topic.
> >
> > Why do you need to run the front controller more than once during run
> > time? It has a dispatch loop allowing you to loop over multiple actions
> > during the same request -- so if you want to build up a widget system,
> > simply create plugins that push and pop from an action stack (this is in
> > fact part of the Zend_Layout proposal).
> >
> > The reason for the front controller being a singleton is in part to
> > simplify access to it from the various other areas (plugins, action
> > controller, etc), but also because, with the loop, there should be no
> > need for multiple instances. Can you better describe *why* you need
> > multiple instances, as well as why looping does not solve this issue?
> >
> >
> > --
> > Matthew Weier O'Phinney
> > PHP Developer | [EMAIL PROTECTED]
> > Zend - The PHP Company | http://www.zend.com/
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/chaining-the-front-controller-tf4625668s16154.html#a13230733
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
--
Matthew Weier O'Phinney
PHP Developer | [EMAIL PROTECTED]
Zend - The PHP Company | http://www.zend.com/