Skip to content
Browse files

Call a few fewer methods.

  • Loading branch information...
1 parent 8b7b139 commit 6378aab439f38ce335e325b2e4414254cff09901 @markstory markstory committed
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/Cake/View/View.php
View
8 lib/Cake/View/View.php
@@ -862,12 +862,16 @@ protected function _render($viewFile, $data = array()) {
$this->_current = $viewFile;
$initialBlocks = count($this->Blocks->unclosed());
- $this->getEventManager()->dispatch(new CakeEvent('View.beforeRenderFile', $this, array($viewFile)));
+ $eventManager = $this->getEventManager();
+ $beforeEvent = new CakeEvent('View.beforeRenderFile', $this, array($viewFile));
+
+ $eventManager->dispatch($beforeEvent);
$content = $this->_evaluate($viewFile, $data);
+
$afterEvent = new CakeEvent('View.afterRenderFile', $this, array($viewFile, $content));
//TODO: For BC puporses, set extra info in the event object. Remove when appropriate
$afterEvent->modParams = 1;
- $this->getEventManager()->dispatch($afterEvent);
+ $eventManager->dispatch($afterEvent);
$content = $afterEvent->data[1];
if (isset($this->_parents[$viewFile])) {

0 comments on commit 6378aab

Please sign in to comment.
Something went wrong with that request. Please try again.