The dispatcher object has a dispatch()
method. This
method looks in the request data to figure out which controller it needs
to instantiate and which task it should execute on it. The controller
object is instantiated through your component's
MVCFactory
service and its execute
and redirect
methods are called on it. So, yes, this is
basically what your old Joomla 3 MVC controller.php
file was doing.
![]() | Tip |
---|---|
Having a custom dispatcher means that you can manipulate the controller and task based on other request variables. This is very important when your component is accessed
outside of a Joomla menu item (no Itemid in the request
variables). In this case Joomla always uses the default
(Home) menu item for the current language. This means that you may be
getting a Your Dispatcher is responsible for figuring out if this is the
case and fix the input variables to prevent weird bugs / showing the
wrong page of your component when it's accessed without a menu item
id, e.g. a URL like |