concrete5/concrete5 — pull request #963 by mkly (2013-03-06 07:27:43+00:00)
Title: Add Event Return to CacheLocal for Events to Use

Add event return to `CacheLocal` for events to use.

Currently, the last event(actually the first event) wins as it is the
only return value that gets passed on. This was mentioned in a bug
report specifically about on_page_output. There is a pretty common use
case for this particular event for modifying the output.

The current implementation of Events make this a little tricky without
breaking any current Events in the wild.

In a perfect world, I would have all events passed a last
parameter that is the return value of the previous event.

Proposed solution is to leverage `CacheLocal` to store the last return
value. This gives each event a chance to grab the return value of the
previous event instead of the original input.

This is a generally tricky spot and is the best backward compatible
solution I could come up with currently.

Very open to new ideas on the subject.