Closed
Description
In my etc/adminhtml/di.xml
I have
<type name="Vendor\Module\Controller\Adminhtml\Controller\Action">
<arguments>
<argument name="registry" xsi:type="object">Magento\Framework\Registry</argument>
</arguments>
</type>
as I'm trying to pass the registry to the constructor:
namespace Vendor\Module\Controller\Adminhtml\Controller;
class Action extends \Magento\Backend\App\Action
{
protected $_registry = null;
/* @var $_registry \Magento\Framework\Registry */
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\Registry $registry)
{
$this->_registry = $registry
parent::__construct($context);
}
However I get this error:
a:4:{i:0;s:404:"Recoverable Error: Argument 2 passed to Vendor\Module\Controller\Adminhtml\Controller\Action::__construct() must be an instance of Magento\Framework\Registry, none given...
With Xdebug I can see that $context
is being passed fine, but there is nothing there for $registry
.