XF 1.5 Get Template Name

I take it you're extending an existing controller?
PHP:
$templateName = $reply->getTemplateName();
 
You'll have to be more descript. How didn't it work? Do you get an error? An empty string? Do you have a code sample?
 
Yes, sorry. So I'm extending XenForo_ControllerPublic_FindNew, changing actionPosts(). There is no $reply declared, so obviously it won't work. I assume that thats something every controller should have in some way?
 
Oh, I'm sorry, completely missed the 1.5 prefix. The reply is the reply object returned by the parent (or the response in 1.5).
PHP:
public function actionPosts()
{
    $response = parent::actionPosts();

    $templateName = $response->templateName;

    return $response;
}
 
Back
Top Bottom