Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

add a view event #2855

Closed
wants to merge 1 commit into from

2 participants

@ClemensSahs
  • add "ViewEvent::EVENT_RENDERER_POST"
@ClemensSahs ClemensSahs add a view event
- add "ViewEvent::EVENT_RENDERER_POST"
e55cff0
@weierophinney

What's the use case? Why can you not simply listen on low (negative) priority on the renderer event?

@ClemensSahs

according to my understanding:

In every case i did it that way the callback function, given to the triggered event, declares the eventstack finished, if the result is an instance of renderer.
In case someone intends to react to the chosen renderer he needs an additional event to do so.

@weierophinney weierophinney referenced this pull request from a commit
@weierophinney weierophinney [#2855] Added test for renderer.post event
- Added a test for the renderer.post event to ensure it gets triggered
8963bcc
@ghost Unknown referenced this pull request from a commit
@weierophinney weierophinney [#2855] Added test for renderer.post event
- Added a test for the renderer.post event to ensure it gets triggered
828b26b
@ghost Unknown referenced this pull request from a commit
@weierophinney weierophinney Merge branch 'feature/2855' into develop
Close #2855
71ebcd9
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-view
@weierophinney weierophinney [zendframework/zf2#2855] Added test for renderer.post event
- Added a test for the renderer.post event to ensure it gets triggered
f56c87d
@weierophinney weierophinney referenced this pull request from a commit in zendframework/zend-view
@weierophinney weierophinney Merge branch 'feature/2855' into develop df319bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 29, 2012
  1. @ClemensSahs

    add a view event

    ClemensSahs authored
    - add "ViewEvent::EVENT_RENDERER_POST"
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 0 deletions.
  1. +3 −0  library/Zend/View/View.php
  2. +1 −0  library/Zend/View/ViewEvent.php
View
3  library/Zend/View/View.php
@@ -186,6 +186,9 @@ public function render(Model $model)
));
}
+ $event->setRenderer($renderer);
+ $results = $events->trigger(ViewEvent::EVENT_RENDERER_POST, $event);
+
// If we have children, render them first, but only if:
// a) the renderer does not implement TreeRendererInterface, or
// b) it does, but canRenderTrees() returns false
View
1  library/Zend/View/ViewEvent.php
@@ -27,6 +27,7 @@ class ViewEvent extends Event
* View events triggered by eventmanager
*/
const EVENT_RENDERER = 'renderer';
+ const EVENT_RENDERER_POST = 'renderer.post';
const EVENT_RESPONSE = 'response';
/**#@-*/
Something went wrong with that request. Please try again.