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

question about the layout in XenForo

Discussion in 'XenForo Development Discussions' started by typostudy, Apr 25, 2013.

  1. typostudy

    typostudy Member

    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: 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.
  2. Jake Bunce

    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.
  3. typostudy

    typostudy Member

    Thanks Jake, got a little bit of understanding.

Share This Page