Discussion in 'XenForo Development Discussions' started by TheJoker, Mar 4, 2013.
Is there any code documentation for XenForo that lists the native classes, their methods, etc.?
Anything? There's gotta be a better way than just browsing through the code...
There isn't anything official at this time. When XenForo first came out, I was lost when it came to MVC. Mike advised me to go through the code, and that is what I did. I had a ton of questions and both Mike and Kier where very helpful in answering, or guiding me. Today there is a lot of tutorials available that you may want to read first, both official and unofficial. Finding a specific class is fairly easy, only because of how XF is structured. Each class is well documented within the file.
Loading of data is handled by a model. If you want to look at what is available for users then it's: library/XenForo/Model/User.php
Controllers handle the action. There are public, admin, response, and helper controllers. Members adjusting their account info (this is public), will be done here: library/XenForo/ControllerPublic/Account.php. Thread controller: library/XenForo/ControllerPublic/Thread.php
If you take a look at the controller file for Thread (just as an example), you should be able to tell exactly where each model, or view, is located as they follow the XenForo/Xxxxxxx/Xxxxxx structure.
This basic tutorial should help: http://xenforo.com/community/threads/creating-an-addon.5416/ I wrote it when I was still learning MVC, and made some changes as I learned more.
I hope this helps in the meantime.
Even a simple PHPDocumenter API type page would be extremely welcome to me. I have a fairly adequate knowledge of PHP, but have never used Zend or any of XF's internal classes.
I have been able to learn PHP from scratch just by looking at the existing XenForo code.
No documentation required.
The best documentation is right there.
True, but we don't all have hours of free time. Provided the code is commented correctly, running PHPDocumentor would only take a couple of minutes and would be extremely helpful. Many other projects use it to provide a basic overview of the classes (such as PyrCMS, Laravel, possibly even Zend Framework). Heck, I might just try running it my self so I can have a class reference to refer to and post a link up for people to use.
The code is very well commented.
I don't have hours of free time either...
Fair enough, just had a look at it for a quick five minutes and it seems most of the core has PHPDocuemntor tags where required. I'll generate the docs my self for personal use.
And here we go, full class reference for the latest release of XF. Might as well let others use it if they find it as useful as I will. Got a full Class, Interface and Method reference.
Excellent. Request to mods to Sticky this for future reference.
Code you provide a downloadable copy as a resource, so developers can install it to their local?
Can do, I'll zip it up and upload it
I've been away for a few days but don't think I've missed that much
Eh, I might have mistyped. Updated. Thanks for pointing that out
Awesome stuff right here, much appreciated!
Thanks this is very helpful
Separate names with a comma.