mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Optimizing helper loading loop in View::_render()
This commit is contained in:
parent
c200fcb062
commit
23174203e3
1 changed files with 5 additions and 5 deletions
|
@ -645,13 +645,13 @@ class View extends Object {
|
|||
|
||||
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');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue