I try to add a new tab on Admin user edit
I use this code,
adminhtml_user_edit.xml
<?xml version="1.0" encoding="utf-8" ?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="Test_adminhtml_user">
<action method="addTab">
<argument name="name" xsi:type="string">custom_tabs</argument>
<argument name="block" xsi:type="string">Testing\test\Block\Adminhtml\User\Tab\Test</argument>
</action>
</referenceBlock>
</body>
</page>
Test.php
<?php
namespace Testing\test\Block\Adminhtml\User\Tab;
/**
* Order custom tab
*
*/
class Test extends \Magento\Backend\Block\Template implements \Magento\Backend\Block\Widget\Tab\TabInterface
{
protected $_template = 'tab/view/test.phtml';
/**
* View constructor.
* @param \Magento\Backend\Block\Template\Context $context
* @param \Magento\Framework\Registry $registry
* @param array $data
*/
public function __construct(
\Magento\Backend\Block\Template\Context $context,
\Magento\Framework\Registry $registry,
array $data = []
) {
$this->_coreRegistry = $registry;
parent::__construct($context, $data);
}
/**
* Retrieve order model instance
*
* @return \Magento\Sales\Model\Order
*/
public function getOrder()
{
return $this->_coreRegistry->registry('permissions_user');
}
/**
* Retrieve order model instance
*
* @return \Magento\Sales\Model\Order
*/
public function getOrderId()
{
return $this->getOrder()->getEntityId();
}
/**
* Retrieve order increment id
*
* @return string
*/
public function getOrderIncrementId()
{
return $this->getOrder()->getIncrementId();
}
/**
* {@inheritdoc}
*/
public function getTabLabel()
{
return __('My Custom Tab');
}
/**
* {@inheritdoc}
*/
public function getTabTitle()
{
return __('My Custom Tab');
}
/**
* {@inheritdoc}
*/
public function canShowTab()
{
return true;
}
/**
* {@inheritdoc}
*/
public function isHidden()
{
return false;
}
}
?>
test.phtml
<div class="fieldset-wrapper order-information">
<div class="fieldset-wrapper-title">
<span class="title"><?php /* @escapeNotVerified */
echo __('Information for new Order tab') ?></span>
</div>
<table class="admin__table-secondary">
<tbody>
<?php echo $block->getChildHtml(); ?>
<tr>
<th><?php /* @escapeNotVerified */
echo __('Order ID:') ?></th>
<td><?php echo $block->getOrderIncrementId(); ?></td>
</tr>
<tr>
<th><?php /* @escapeNotVerified */
echo __('Last History:') ?></th>
<td><?php echo __('History of order') ?></td>
</tr>
</tbody>
</table>
</div>
but it's not displaying on admin user edit page, is there any solution ?