I am trying to override customer/account/editpost controller.
I am getting error
Recoverable Error: Argument 1 passed to Magento\Customer\Controller\Account\EditPost::__construct() must be an instance of Magento\Framework\App\Action\Context
I created di.xml file at location module/etc/di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Customer\Controller\Account\EditPost"
type="Namespace\Modulename\Controller\Index\Editpost" />
</config>
and controller Controller\Index\Editpost.php
namespace Namespace\Modulename\Controller\Index;
class Editpost extends \Magento\Customer\Controller\Account\EditPost
{
public function execute()
{
echo "asdasdsda"; die;
return parent::execute();
}
}
var/generation
and try again.