I am trying to create new tab in customer dashboard.I have added customer_account.xml in my module(Singh/Module1)layout
<body>
<referenceBlock name="customer_account_navigation">
<block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-about-me">
<arguments>
<argument name="path" xsi:type="string">aboutme/customer/index</argument>
<argument name="label" xsi:type="string" translate="true">About Me</argument>
</arguments>
</block>
</referenceBlock>
</body>
frontName : aboutme;
My Controller directory structure: Singh/Module1/Controller/Customer/Index.php.
I have created aboutme_customer_index.xml also
<update handle="customer_account"/>
<body>
<referenceContainer name="content">
<block class="Magento\Customer\Block\Account\Dashboard" name="customer.account.link.back" template="account/link/back.phtml" cacheable="false"/>
</referenceContainer>
</body>
Below is the index.php
class Index extends \Magento\Framework\App\Action\Action //implements AboutmeInterface
{
/**
* @var PageFactory
*/
protected $resultPageFactory;
/**
* @param Context $context
* @param PageFactory $resultPageFactory
*/
public function __construct(
Context $context,
PageFactory $resultPageFactory
) {
$this->resultPageFactory = $resultPageFactory;
parent::__construct($context);
}
/**
* Customer order history
*
* @return \Magento\Framework\View\Result\Page
*/
public function execute()
{
/** @var \Magento\Framework\View\Result\Page $resultPage */
$resultPage = $this->resultPageFactory->create();
$resultPage->getConfig()->getTitle()->set(__('About Me'));
$block = $resultPage->getLayout()->getBlock('customer.account.link.back');
if ($block) {
$block->setRefererUrl($this->_redirect->getRefererUrl());
}
return $resultPage;
}
}
Below is my route file
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="aboutme" frontName="aboutme">
<module name="Singh_Module1" />
</route>
</router>
My new tab is coming in Customer account dashboard but it always redirect to 404 not found error.