mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
Helpers addressed by $this->Helper->func()
This commit is contained in:
parent
1b063d6218
commit
75695341fa
2 changed files with 12 additions and 2 deletions
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue