[eluser]Tim Reynolds[/eluser]
I am having problems with assigning a new element to an array during a foreach loop.
While echoing the alias of the array position inside the foreach the new element seems to have been created and populated correctly. When you print the array outside the loop it does not contain the new fields. The code is part of a big method but the snippet is included,
Code:
$this->CI->template['navigation'] = $this->CI->page->getNav(0);
foreach($this->CI->template['navigation'] as $nav){
$subnav = $this->CI->page->getSubNav($nav['path']);
$nav['subnav'] = $subnav;
}
Is this the correct method of performing this operation? I can post more code/debug info if needed.
Thanks