I'm trying to override function actionPreview in the Thread controller, and am getting this error:
ErrorException: [E_WARNING] Declaration of SageWebDesign\ThreadPreview\XF\Pub\Controller\Thread::actionPreview() should be compatible with XF\Pub\Controller\Thread::actionPreview(XF\Mvc\ParameterBag $params)
Here is my code:
<?php
namespace SageWebDesign\ThreadPreview\XF\Pub\Controller;
class Thread extends XFCP_Thread
{
/**
* Gets a preview of the last post in a thread.
*
* @return XenForo_ControllerResponse_Abstract
*/
public function actionPreview()
{
$reply = parent::actionPreview();
if ($reply.getParam('post') != false)
{
$reply->setParam('post', $postModel->getPostById($thread['last_post_id'],
array('join' => XenForo_Model_Post::FETCH_USER)));
}
return $reply;
}
}
ErrorException: [E_WARNING] Declaration of SageWebDesign\ThreadPreview\XF\Pub\Controller\Thread::actionPreview() should be compatible with XF\Pub\Controller\Thread::actionPreview(XF\Mvc\ParameterBag $params)
Here is my code:
<?php
namespace SageWebDesign\ThreadPreview\XF\Pub\Controller;
class Thread extends XFCP_Thread
{
/**
* Gets a preview of the last post in a thread.
*
* @return XenForo_ControllerResponse_Abstract
*/
public function actionPreview()
{
$reply = parent::actionPreview();
if ($reply.getParam('post') != false)
{
$reply->setParam('post', $postModel->getPostById($thread['last_post_id'],
array('join' => XenForo_Model_Post::FETCH_USER)));
}
return $reply;
}
}