question about the layout in XenForo

typostudy

Member
I am checking this file: xenforo\library\XenForo\ControllerPublic\Forum.php
Questions:
1. is this a controller:Forum.php? If I want to view this page in frontend, how should I do? I tried this one: mysite.com/xenforo/Forum, 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: mysite.com/project/public/index/add, 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.
 
You can find the content template:

http://xenforo.com/community/threads/1-0-0-b1-how-to-identify-the-root-template-of-a-page.5591/

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":

http://xenforo.com/community/forums/xenforo-development-discussions.34/create-thread

That calls the actionCreateThread function in the forum controller.
 
Top Bottom