Currently, I am using the
beforeExecuteRoute on a base controller to disable the layouts on an ajax response, allowing just the view to be returned. So I am checking if the request is an ajax/pjax response, and if it is, I am disabling the layouts.
I want to disable the layouts at the last minute before the view begins being processed, to allow individual controllers to override the fact that it is pjax and force a hard refresh.
What event would be the best option for updating this before the view is sent?
afterDispatchLoop? I am unsure of the difference between those two. Maybe
I would appreciate any guidance and I'm happy to clarify if needed.