I can get into the execute()
function if I do not run the construct function. but I cannot find the bug in my __construct
function.
The file is \app\code\Cleargo\Contactus\Controller\Adminhtml\Grid\Index.php
namespace Cleargo\Contactus\Controller\Adminhtml\Grid;
use Magento\Backend\App\Action;
class Index extends Action
{
const ADMIN_RESOURCE = 'Cleargo_Contactus::add_row';
protected $resultPageFactory;
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\View\Result\PageFactory $resultPageFactory
){
parent::__construct($context);
$this->resultPageFactory = $resultPageFactory;
}
public function execute()
{
$resultPage = $this->resultPageFactory->create();
$resultPage->getConfig()->getTitle()->prepend(__('Department'));
return $resultPage;
}
}