-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block must know nothing about his parent #16
Comments
Hi @stalniy, currently blocks don't store information about their parents. Layout object is responsible for storing all parent-child relations. |
…arent-element-theme [Extensibility] Magetwo 31776 add parent element theme
[Amigos] Community Contributions 2.4-develop - Patch 5
Why? Example from life: children will never know all about his parents. So i think, you need to change Mage_Core_Block_Abstract::setParentBlock method to Mage_Core_Block_Abstract::setParentName. And rewrite Mage_Core_Block_Abstract::getParentBlock to
public function getParentBlock()
{
$layout = $this->getLayout();
if ($layout) {
return $layout->getBlock($this->_parentName);
}
}
The text was updated successfully, but these errors were encountered: