Development

#1973 (change filter chain to preserve request filters with forwarding)

You must first sign up to be able to contribute.

Ticket #1973 (new enhancement)

Opened 1 year ago

Last modified 3 months ago

change filter chain to preserve request filters with forwarding

Reported by: mahono Assigned to: fabien
Priority: major Milestone: 1.2.0
Component: controller Version:
Keywords: filter chain Cc:
Qualification: Unreviewed

Description

There is a design mistake in the filter chain: Any sfController->forward() as well as sfController->getPresentationFor() discards the whole current filter chain and starts a new one.

This makes it almost impossible to implement a cms like page controller where arbitrary actions can be embedded in areas on a page in a clean and efficient way.

What we need is a way to keep request filters like rendering, web_debug, common and flash even with forwards. I think we also need a way to insert a filter after/before each filter that is already in the chain. Last but not least there must be a way to run parts of the filter chain again and again to make it possible to execute nested actions as fast as possible.

So there should probably also be a way to define a filter as "request filter" (is preserved with a forward) and "action filter" (is only valid for an action) -> but it maybe useful to even reuse action filters.

Change History

08/22/07 17:19:25 changed by mahono

I implemented a possible solution in the mahono branch.

The most important thing that should make its way into the trunk is to change the ActionStack? to open it for arbitrary variables as I implemented it with the sfControllerStack / Entry classes.

And the second important one is to change the signature of forward() to make it possible to optionally add $options and to optionally omit $action so that $module can also be a $pageId or whatever implemented by other (controller) plugins.

04/04/08 19:02:09 changed by mahono

  • qualification set to Unreviewed.

Times (and features) change..

Thanks to the new flexibility of sf 1.1 I was able to implement a working page controller (alternative controller and execution filter) in the mdPageControllerPlugin which I will publish very soon (in about 4 weeks).

So.. I'm not sure if we (I) need this ticket anymore. I'm still not really happy with the current controller/filter chain: IMHO "action" must be clearly separated from "request" to really make it a flexible system. But it's now flexible enough to provide all I want by a plugin -- but you will see that my solution shows the limitations of the current symfony controller.

06/17/08 19:07:47 changed by dwhittle

Do you have a proposed solution?

06/29/08 22:44:47 changed by FabianLange

  • milestone changed from 1.1.0 to 1.2.0.