I am inside a phtml file, how can I get the list of children blocks within the current template?
$children = $this->getChild();
Check the code within app/code/Mage/Core/Block/Abstract.php
public function getChild($name = '')
{
if ($name === '') {
return $this->_children;
} elseif (isset($this->_children[$name])) {
return $this->_children[$name];
}
return false;
}
So if no name is given, it simply returns all children.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With