Search code examples
phpxenforo

XenForo 1.5 set page title with PHP


I use this code to display a page node iin XenForo with my custom PHP code:

 class 65434634_page_ControllerPublic_test
{
    public static function getTest(XenForo_ControllerPublic_Abstract $controller, XenForo_ControllerResponse_Abstract &$response)
    {
        $page_title = "not working";
        $response->params['page.title'] = $page_title;
        $response->params['title'] = $page_title;
        $response->params['html'] = $html;
        return $response;
   
    }
}

But how can I set the page title?

I also added the title to the template, but it doesn't display


Solution

  • Solution:

    $response->params['page']['title'] = $page_title;
    

    Thanks to Boothby from Xenforo Support Forum