• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Extending XenForo_Html_Renderer_BbCode, what event to listen to ?

allewreK

Active member
#1
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.
 

Chris D

XenForo developer
Staff member
#4
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.
 

Chris D

XenForo developer
Staff member
#6
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
 

Marcus

Well-known member
#14
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.