Lukas W.
Well-known member
Currently struggling with finding the right entry point for this. Goal is to add a JSON parameter to XF\Pub\Controller\Thread::actionAddReply.
I've previously done so in the controller through calling the
It seems the request still gets passed through the
Anyone got an idea how to achieve this more gracefully? I've thought about initializing the templater variables at controller level, but I reckon this might also cause compatibility issues.
I've previously done so in the controller through calling the
setJsonParam()
method on the response object, but it seems that the templater isn't fully initialized on controller level yet, so rendering post messages there throws errors in some circumstances. I've attempted to move this to the view class XF\Pub\View\Thread\NewPosts
, but as the class doesn't exit, there's no renderJson()
method to extend and thus only the default mechanism that converts the HTML response to JSON handles the reply.It seems the request still gets passed through the
renderJson()
method I created as a test and afterwards is processed correctly to the reply, but I don't seem to be able to add any json parameters from there without having to recreate the full response myself, which seems a nightmare for compatibility.Anyone got an idea how to achieve this more gracefully? I've thought about initializing the templater variables at controller level, but I reckon this might also cause compatibility issues.