Extending XenForo_Html_Renderer_BbCode, what event to listen to ?

Jean-Baptiste

Well-known member
Hello,

I would like to redefine a method in the XenForo_Html_Renderer_BbCode class.

What event do I have to listen to (in code event listener)?

Best regards.
 
Almost any class...

From the details of the event:

Called when instantiating a class. This event can be used to extend the class that will be instantiated dynamically. Note that not all classes that are to be instantiated will call this but many will.
 
Not sure it works with XenForo_Html_Renderer_BbCode... I could be wrong, but I sort of recall I tried it for something and it didn't.
 
It does work. I did a quick test before I suggested it as I wasn't sure myself it would work or not. :-)

I was able to overwrite and extend a couple of functions no problem
 
Helpers are loaded via direct calls, so a different system would have to be baked in for those.
 
I can confirm you that I correctly extended the class XenForo_Html_Renderer_BbCode.
It works, the class BbCode_TextWrapper doesn't like to be extended. It took me some time to figure it out, that it was entirely not possible :D I am very thankful to the great community here where experienced developers help out beginners.
 
Top Bottom