Hello,
trying to read post data after customer registration. This is my observer so far:
<?php namespace Hoop\Util\Observer; use Magento\Framework\Event\ObserverInterface; class AfterCustomerRegistration implements ObserverInterface { protected $request; public function __construct(\Magento\Framework\App\Request\Http $request ) { $this->request = $request; } public function execute(\Magento\Framework\Event\Observer $observer) { var_dump($this->request->getPost()); die('test'); } }
I get:
Fatal error: Uncaught TypeError: Argument 1 passed to Hoop\Util\Observer\AfterCustomerRegistration::__construct() must be an instance of Magento\Framework\App\Request\Http, instance of Magento\Framework\ObjectManager\ObjectManager given...
any suggestion?
thanks a lot
Solved! Go to Solution.
Could you run below command and check,
php bin/magento setup:di:compile
that made it, thanks a lot!
You need to remove generated folder from root except .htaccess file.
Clear cache and check again.
hey Rakesh,
thanks for answering. After I did that, I get this in the exception.log:
main.CRITICAL: RuntimeException: Source class "" for "Magento\Framework\App\Response\Http\Interceptor" generation does not exist
any further suggestion?
thank you
I'm not sure I understand what you say...
this is my observer: app/code/Hoop/Util/Observer/AfterCustomerRegistration.php
did I answer?
Could you run below command and check,
php bin/magento setup:di:compile