question about the layout in XenForo


I am checking this file: xenforo\library\XenForo\ControllerPublic\Forum.php
1. is this a controller:Forum.php? If I want to view this page in frontend, how should I do? I tried this one:, but it does not work.
2. How does view/controller work in XenForo? In zend framework1, normally we have IndexController, then we can put action inside, eg. public function addAction(), then we have views\scripts\index\add.phtml, we can use this to show the output, we can see the final result using this url:, so how does view/controller work in XenForo? Now I do not care too much about model, I think it is also mostly dealing with DB in XenForo, the layout/template is my concern now.

Jake Bunce

XenForo moderator
Staff member
You can find the content template:

Then search the files for that template name. It is used in the return value of the controller.

The controller that is used is named in the route handler. For an example look in XenForo_Route_Prefix_Forums which names XenForo_ControllerPublic_Forum. The action is part of the URL. For example, this URL has an action of "create-thread":

That calls the actionCreateThread function in the forum controller.