magento 2 result page factory create object

Solutions on MaxInterview for magento 2 result page factory create object by the best coders in the world

showing results for - "magento 2 result page factory create object"
Vincenzo
20 Apr 2019
1app/code/Pbritka/HelloWorld/Controller/Page/Index.php
2<?php
3
4namespace Pbritka\HelloWorld\Controller\Page;
5
6class Index extends \Magento\Framework\App\Action\Action {
7
8    protected $_pageFactory;
9
10    public function __construct(\Magento\Framework\View\Result\PageFactory $pageFactory,
11                                \Magento\Framework\App\Action\Context $context) {
12        $this->_pageFactory = $pageFactory;
13        parent::__construct($context);
14    }
15
16    public function execute() {
17        $page = $this->_pageFactory->create();
18        return $page;
19    }
20}
21
22