Redirect a controller action using a factory in Magento
Magento 2 redirect controller tutorial using RedirectFactory to route blog to blog post list.
Lesson Content
At the moment, we need to visit /blog/post/list to get our blog post list action, which will eventually be used to display all blog posts. It would be nice to set up the /blog URL to display these blog posts though, as that is a good entry point to our blog that we can link to and is easier to type.
We already have an Index.php file returning a die response for this controller.
<?php
declare(strict_types=1);
namespace Macademy\Blog\Controller\Index;
use Magento\Framework\App\Action\HttpGetActionInterface;
clas...
Join the discussion!
Comments
Want to comment on this lesson?
Enroll in this course to leave comments.