XF 2.1 Reusing XF functionality

eberkund

Well-known member
Hello, I have done a lot of development with Laravel and now I am trying to get into XenForo to create an add-on for my site.

One thing that was't clear to me from the docs was what functionality is available for me to reuse in my add-on. For example, what if I am not trying to override an entity but want to create a new entity which is a distinct entity in my application but uses a lot of the same functionality of one that already exists? Same goes for stuff like, the editor, validation logic - clearly a lot of this stuff exists within XF core already. But when creating an add-on is it necessary to rewrite any of this stuff?

Thanks
 
Last edited:

Jeremy P

XenForo developer
Staff member
Beyond what's available in the developer documentation, you have to dig into the code to get a feel for how things are designed and put together. Generally speaking, most of the functionality is designed to be reusable in some way or another. You can get a broad idea of what systems are designed around content type entities by having a look at the content types page in your Admin CP. Tying into these systems generally involves adding a handler class and making additions to the entity structure. For controllers, various controller plugins are available for common use cases, including pages which tie into the content type systems.

It can feel a bit opaque at first, but eventually you get the hang of it. If you have any specific questions about how to accomplish something, somebody will usually be happy to point you in the right direction.
 
Top