0

a:4:{i:0;s:562:"Recoverable Error: Argument 3 passed to yyy\xxx\Controller\Adminhtml\Items::__construct() must be an instance of Magento\Framework\View\Result\PageFactory, instance of Magento\Backend\App\Response\Http\FileFactory given, called in magento2/var/generation/yyy/xxx/Controller/Adminhtml/Items/Index/Interceptor.php on line 15 and defined in magento2/app/code/yyy/xxx/Controller/Adminhtml/Items.php on line 22";i:1;s:5398:"#0 magento2/app/code/yyy/xxx/Controller/Adminhtml/Items.php(22): Magento\Framework\App\ErrorHandler->handler(4096, 'Argument 3 pass...', '/home/exdev/dom...', 22, Array)

this is my code

    <?php

/**
 * Copyright © 2015 Orange. All rights reserved.
 */

namespace yyy\xxx\Controller\Adminhtml;

/**
 * Items controller
 */
class Items extends \Magento\Backend\App\Action {

    public $_coreRegistry = null;
    public $_resultPageFactory = null;
    public $_resultRedirectFactory = null;

    public function __construct(
    \Magento\Backend\App\Action\Context $context,
    \Magento\Framework\Registry $coreRegistry, 
    \Magento\Framework\View\Result\PageFactory $resultPageFactory
    ) {
        $this->_coreRegistry = $coreRegistry;
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }    
protected function _initAction()
    {
        $this->_view->loadLayout();
        return $this;
    }

public function execute()
    {

    }
}
  • have you tried with removing var/generation and var/cache folder and then run setup:id:compile command ? if not try with it – Manthan Dave Jan 23 '17 at 9:24
  • yes i tried but not working – Pawankumar Jan 23 '17 at 9:28
  • remove cache and setup upgrade can help... – Ashish Raj Oct 16 '17 at 5:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.