Skip to content

Magento 2.4.7-p3 Deprecate class ActionAction and constructor parent::__construct($context);

<?php
declare(strict_types=1);

namespace ModuleCoordControllerIndex;

class Index extends MagentoFrameworkAppActionAction
{

    protected $resultPageFactory;

    /**
     * Constructor
     *
     * @param MagentoFrameworkAppActionContext  $context
     * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
     */
    public function __construct(
        MagentoFrameworkAppActionContext $context,
        MagentoFrameworkViewResultPageFactory $resultPageFactory
    ) {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    /**
     * Execute view action
     *
     * @return MagentoFrameworkControllerResultInterface
     */
    public function execute()
    {
        return $this->resultPageFactory->create();
    }
}