Skip to content
Permalink
Browse files

Optimizing helper loading loop in View::_render()

  • Loading branch information...
nateabele committed Feb 6, 2009
1 parent c200fcb commit 23174203e3e17b34b8e56ac461a3b5bfd729e0b8
Showing with 5 additions and 5 deletions.
  1. +5 −5 cake/libs/view/view.php
@@ -645,13 +645,13 @@ function _render($___viewFn, $___dataForView, $loadHelpers = true, $cached = fal
if ($this->helpers != false && $loadHelpers === true) {
$loadedHelpers = $this->_loadHelpers($loadedHelpers, $this->helpers);
$helpers = array_keys($loadedHelpers);
$helperNames = array_map(array('Inflector', 'variable'), $helpers);
foreach (array_keys($loadedHelpers) as $helper) {
$camelBackedHelper = Inflector::variable($helper);
${$camelBackedHelper} =& $loadedHelpers[$helper];
$this->loaded[$camelBackedHelper] =& ${$camelBackedHelper};
for ($i = count($helpers) - 1; $i >= 0; $i--) {
${$helperNames[$i]} =& $loadedHelpers[$helpers[$i]];
$this->loaded[$helperNames[$i]] =& ${$helperNames[$i]};
}
$this->_triggerHelpers('beforeRender');
}

0 comments on commit 2317420

Please sign in to comment.
You can’t perform that action at this time.