Is there possible get request type in controller? How?
To detect if the request is a master or not requires the use of the RequestStack
, which should be injected into your controller. The request stack has 3 useful methods
getCurrentRequest();
getMasterRequest();
getParentRequest();
The getParentRequest()
will always return null if the current request is the master.