Permalink
Browse files

Helpers addressed by $this->Helper->func()

  • Loading branch information...
1 parent 1b063d6 commit 75695341fa1a7acf00a1ee124c29e1fdf76c602c @evilbloodydemon evilbloodydemon committed with markstory Sep 2, 2009
Showing with 12 additions and 2 deletions.
  1. +7 −2 cake/libs/view/view.php
  2. +5 −0 cake/tests/cases/libs/view/view.test.php
View
@@ -696,8 +696,13 @@ function _render($___viewFn, $___dataForView, $loadHelpers = true, $cached = fal
$helperNames = array_map(array('Inflector', 'variable'), $helpers);
for ($i = count($helpers) - 1; $i >= 0; $i--) {
- ${$helperNames[$i]} =& $loadedHelpers[$helpers[$i]];
- $this->loaded[$helperNames[$i]] =& ${$helperNames[$i]};
+ $name = $helperNames[$i];
+
+ ${$name} =& $loadedHelpers[$helpers[$i]];
+ $this->loaded[$name] =& ${$name};
+
+ $memberName = Inflector::camelize($name);
+ $this->{$memberName} =& ${$name};
}
$this->_triggerHelpers('beforeRender');
}
@@ -653,6 +653,11 @@ function testRenderLoadHelper() {
$this->assertTrue(is_object($helpers['form']->Html));
$this->assertTrue(is_object($helpers['ajax']->Html));
$this->assertTrue(is_object($helpers['pluggedHelper']->OtherHelper));
+
+ $this->assertTrue(is_object($View->Html));
+ $this->assertTrue(is_object($View->Form));
+ $this->assertTrue(is_object($View->Form->Html));
+ $this->assertTrue(is_object($View->PluggedHelper->OtherHelper));
}
/**

0 comments on commit 7569534

Please sign in to comment.