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

This commit is contained in:
evilbloodydemon 2009-09-02 10:53:21 +04:00 committed by mark_story
parent 1b063d6218
commit 75695341fa
2 changed files with 12 additions and 2 deletions

View file

@ -696,8 +696,13 @@ class View extends Object {
$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');
}

View file

@ -653,6 +653,11 @@ class ViewTest extends CakeTestCase {
$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));
}
/**