The Dispatcher’s job is to find a class which can handle the current page
request. Once found, the dispatcher executes the method handleRequest in the
matching class and receives the result. This result is then passed out as
website content.

Because multiple RequestHandlers can be responsible for a request, a
prioritisation system is necessary. This is because only one RequestHandler can
take responsibility. Default priority is set to 100. If another RequestHandler
needs to take priority, the method getPriority() should return a higher
value.

Once the definitive RequestHandler has been identified, its method
handleRequest() is executed. This method creates an object containing all
of the necessary data for the page request, using the RequestBuilder. It
searches through the plugin configuration in ext_localconf.php in order
to find out which Controller and Action should be used as standard. The
RequestBuilder also checks the Uri, to check whether an alternative Controller
or an alternative action should be loaded instead of the entries from
ext_localconf.php.

Note

Extbase does not use PSR-7 implementation for Request and Response, but
custom implementations.

A Response object is now created, which contains the header data and content.
These include status codes (like Error 404), as well as the necessary
JavaScript and CSS files. This object is empty at this point, ready to be filled
by the Dispatcher.

The Dispatcher fetches the Controller name from the Request object and creates
the Controller.

The object Request and the currently empty object Response are
passed to the the Controller, and the role of the Dispatcher is complete. The
Controller now modifies the response, which is handed back all the way to the
Bootstrap which calls shutdown(). It’s now up to the response to
handle further stuff, e.g. send headers and return rendered content.

That’s the point when TYPO3 receives the content and integrates it into the
rendering. The response itself will already send headers, no TYPO3 API will be
used at this place.

Within the controller, $this->request allows to access the incoming
Request. This way it’s possible to directly access all arguments provided to the
request. Still it’s better to use argument mapping instead.

In case of an forward, the request also enables access to the original request.
Further information like the controller name and plugin name can be retrieved
from the request.

Arguments can be accessed through:

$this->request->getArgument('argumentName');

In order to make arguments available within the Request, or for mapping, they
need to conform to Extbase naming standard, in order to be mapped to the
extension. The default is to prefix arguments with plugin signature. This can be
adjusted via TypoScript option view.pluginNamespace, see
view.