I am following a tutorial about Magento version 2.4.2, and I am getting a problem while using Action as It shows deprecation, and also even after cleaning cache, the error shown is Required parameter 'theme_dir' was not passed
This is my code if anyone has an idea
<?php
namespace SimplifiedMagento\RequestFlow\Controller\Page;
use Magento\Framework\App\Action\Action;
use Magento\Framework\App\ResponseInterface;
class CustomNoRoute extends Action
{
public function execute()
{
echo "this is our custom 404";
}
}
The code after update
namespace SimplifiedMagento\RequestFlow\Controller\Page;
use Magento\Framework\App\ActionInterface;
use Magento\Framework\App\ResponseInterface;
class CustomNoRoute implements ActionInterface
{
public function execute()
{
echo "this is our custom 404";
}
}
I got this new error after resolving a problem related to the theme
Call to a member function get() on null in C:\xampp-clean\htdocs\magento242\vendor\magento\framework\App\Action\Action.php:109 Stack trace: #0 C:\xampp-clean\htdocs\magento242\vendor\magento\framework\App\FrontController.php(186): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http)) #1 C:\xampp-clean\htdocs\magento242\vendor\magento\framework\App\FrontController.php
Well after changing my code to this
<?php
namespace SimplifiedMagento\RequestFlow\Controller\Page;
use Magento\Framework\App\ActionInterface;
use Magento\Framework\App\ResponseInterface;
class CustomNoRoute implements ActionInterface
{
public function execute()
{
echo "this is our custom 404";
}
}
I am getting this output :
this is our custom 4041 exception(s):
Exception #0 (InvalidArgumentException): Invalid return type
Exception #0 (InvalidArgumentException): Invalid return type
<pre>#1 Magento\Framework\App\Http\Interceptor->launch() called at [vendor\magento\framework\App\Bootstrap.php:263]
#2 Magento\Framework\App\Bootstrap->run() called at [pub\index.php:29]
</pre>
So at least it is echoing the result ;
Thanks in advance