Skip to content

Commit

Permalink
Call a few fewer methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Nov 10, 2012
1 parent 8b7b139 commit 6378aab
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/Cake/View/View.php
Expand Up @@ -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])) {
Expand Down

0 comments on commit 6378aab

Please sign in to comment.