I am following Alan Storm's tutorial and am getting an error
Controller:
<?php
namespace Pulsestorm\HelloWorldMVVM\Controller\Hello;
use Magento\Framework\View\Result\PageFactory;
use Magento\Framework\App\Action\Context;
class World extends \Magento\Framework\App\Action\Action
{
protected $pageFactory;
public function __construct(Context $context, PageFactory $pageFactory)
{
$this->pageFactory = $pageFactory;
return parent::__construct($context);
}
public function execute()
{
var_dump(__METHOD__);
$page_object = $this->pageFactory->create();;
return $page_object;
}
}
Error:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function Pulsestorm\HelloWorldMVVM\Controller\Hello\World::__construct(), 1 passed in /var/www/html/generated/code/Pulsestorm/HelloWorldMVVM/Controller/Hello/World/Interceptor.php on line 14 and exactly 2 expected in /var/www/html/app/code/Pulsestorm/HelloWorldMVVM/Controller/Hello/World.php:9 Stack trace: #0 /var/www/html/generated/code/Pulsestorm/HelloWorldMVVM/Controller/Hello/World/Interceptor.php(14): Pulsestorm\HelloWorldMVVM\Controller\Hello\World->__construct(Object(Magento\Framework\App\Action\Context)) #1 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(111): Pulsestorm\HelloWorldMVVM\Controller\Hello\World\Interceptor->__construct(Object(Magento\Framework\App\Action\Context)) #2 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(66): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Pulsestorm\\Hell...', Array) #3 /var/www/html/vendor/magento/framework/ObjectManager in /var/www/html/app/code/Pulsestorm/HelloWorldMVVM/Controller/Hello/World.php on line 9