I tried to add phtml to customer account edit in backend like this:
app/code/Namespace/Module/view/adminhtml/layout/customer_index_edit.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block class="Namespace\Module\Block\Adminhtml\Customer\Edit" name="customer_block_adminhtml_index_edit_custom" cacheable="false" template="Namespace_Module::customer_index_edit.phtml" />
</referenceContainer>
</body>
</page>
app/code/Namespace/Module/Block/Adminhtml/Customer/Edit.php
<?php
namespace Namespace\Module\Block\Adminhtml\Customer;
use Magento\Customer\Api\AccountManagementInterface;
use Magento\Customer\Api\CustomerRepositoryInterface;
use Magento\Customer\Controller\RegistryConstants;
class Edit extends \Magento\Backend\Block\Widget\Form\Container
{
public function __construct(
\Magento\Backend\Block\Widget\Context $context,
\Magento\Framework\Registry $registry,
AccountManagementInterface $customerAccountManagement,
CustomerRepositoryInterface $customerRepository,
\Magento\Customer\Helper\View $viewHelper,
array $data = []
) {
$this->_coreRegistry = $registry;
$this->customerAccountManagement = $customerAccountManagement;
$this->customerRepository = $customerRepository;
$this->_viewHelper = $viewHelper;
parent::__construct($context, $data);
}
}
app/code/Namespace/Module/view/adminhtml/templates/customer_index_edit.phtml
<h1> This is new section </h1>
but this is not working at all