Error in controller :- Undefined property: SimpleMagento\Custom\Controller\Test\First\Interceptor::$getRequest .......While fetching data from custom form. Can someone provide me solution or how to fetch data from custom form to controller ... Magento 2

Or else how to fetch data from custom form and store it to the custom table in DB.

2 Answers 2


somwhere in the class SimpleMagento\Custom\Controller\Test\First there is this:

$this->getRequest instead of $this->getRequest(). Missing ()


Seems, you have using the code $getRequest at SimpleMagento\Custom\Controller\Test\First. $getRequest wrong variable if you want to get form posted data at this URL.

Then you have to use

$this->getRequest() instead of $getRequest

Use $this->getRequest()->getParams() for getting All fields value, this getParams() give value in key-value format

Also $this->getRequest()->getPostValues() can use. Donot forgot to get do compile

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.