How do I reset a setData variable within a view?
Example: view.phtml:
$this->getChild('additional')->setData('foo', 'Bar');
if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>
<?php foreach ($detailedInfoGroup as $alias => $html):?>
<?php echo $html ?>
<?php endforeach;?>
<?php endif;
attributes.phtml
echo $this->getData('foo'); // returns: Bar
When I am trying to set the data again but with another value (within view.phtml) like:
view.phtml:
$this->getChild('additional')->setData('foo', 'Second');
if ($detailedInfoGroup = $this->getChildGroup('detailed_info', 'getChildHtml')):?>
<?php foreach ($detailedInfoGroup as $alias => $html):?>
<?php echo $html ?>
<?php endforeach;?>
<?php endif;
attributes.phtml
echo $this->getData('foo'); // it still returns: Bar
How do I update this variable foo?
Thanks,
Martijn