I add the controller in my local but it not working.
di.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<preference for="Magento\Customer\Controller\Account\CreatePost" type="Tychons\Registration\Controller\Account\CreatePost" />
</config>
module.xml
<?xml version="1.0"?>
<!--
/**
* Module configuration.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Tychons_Registration" setup_version="1.0.0" />
</config>
Createpost.php
namespace Company\Custom\Controller\Catalog\Product;
class View extends Tychons\Registration\Controller\Account\CreatePost
{
public function execute()
{
echo "create post";exit;
}
}
composer.json
{
"name": "tychons/registration",
"description": "Manage Registartion",
"type": "magento2-module",
"version": "1.0.0",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"autoload": {
"files": [
"registration.php"
],
"psr-4": {
"Tychons\\Registartion\\": ""
}
}
}
registratio.php
<?php
/**
* Module configuration
*/
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::MODULE,
'Tychons_Registation',
__DIR__
);
Please anyone can help me.
Tychons\\Registartion\\"
should be REGISTRATION