I refered to https://www.magestore.com/magento-2-tutorial/how-to-create-an-admin-form-look-like-a-configuration-page-magento-2-configuration-p3/ but there is an issue.

namespace Demo\Pro\Controller\Adminhtml\Index;

class Configuration extends \Magento\Backend\App\Action

    * @var PageFactory
    protected $resultPageFactory;

 * constructor
 *@param Context $context
 *@param PageFactory $resultPageFactory;
 * @return void
protected function _construct(
    \Magento\Backend\App\Action\Context $context,
     \Magento\Framework\View\Result\PageFactory $resultPageFactory
) {
    $this->resultPageFactory = $resultPageFactory;

* Index action
*@return \Magento\Backend\Model\View\Result\Page
public function execute()
    /** @var \Magento\Backend\Model\View\Result\Page $resultPage */
    $resultPage = $this->resultPageFactory->create();
    $resultPage->getConfig()->getTitle()->prepend(__('SL Pages Authentication'));
    return $resultPage;
  • This is the error - Fatal error: Call to a member function create() on null in \Controller\Adminhtml\Index\Configuration.php on line 50
    – subhas
    Commented Oct 4, 2017 at 15:24

1 Answer 1


Change your constructor to public and add one more underscore to your constructors name and it's parent too. May fix it.

Your Answer

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

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