Map interfaces to concrete classes with XML in Magento
Learn how Magento maps RequestInterface implementations to classes using di.xml preferences and dependency injection.
Lesson Content
Let’s search PhpStorm for this class name Magento\Framework\App\RequestInterface and open up this file.
This interface defines functions used to retrieve information related to the current web request. If we look through it we’ll see getModuleName(), getActionName(), getParam(), setParams() & more.
You’ll notice a little “i” icon in PhpStorm. Click it, and you’ll see all classes which implement this interface. This is a major time saver!

You’ll notice that t...
Join the discussion!
Comments
Want to comment on this lesson?
Enroll in this course to leave comments.