#StackBounty: #magento2 #template How to pass variable to $block->getChildHtml('form_additional_info')

Bounty: 50

I need to pass the customer object from the edit.phtml template to a child template:

I have this but it does not work:

<?php
$block->getChildBlock('form_additional_info')->setData('customer', $block->getCustomer());
echo $block->getChildHtml('form_additional_info', false);
?>

Error is PHP Fatal error: Uncaught Error: Call to a member function setData() on bool

Any help?


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.