I am implementing a demo project using Phalcon and jQuery PJAX.
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? afterDispatch
? afterDispatchLoop
? I am unsure of the difference between those two. Maybe afterExecuteRoute
?
I would appreciate any guidance and I'm happy to clarify if needed.
Thank you