Adding data to a response?

Z61

Well-known member
I'm attempting to add some additional data onto the end of a response for a report. I cannot seem to get it to work right and it cuts off the content of the report.
Code:
  function actionView()
  {
  $options = XenForo_Application::get('options');
  $response = parent::actionView();
  $data["commentHideTime"] = strtotime($options->z61_days . " days");
  return $this->responseView('XenForo_ViewPublic_Report_View', 'report_view', array_merge($data, $response->params));
  }
Anyone know a proper way of doing this?
 
Last edited:
Not sure what you are trying to achieve here, but the best approach for what you've posted would be:

PHP:
public function actionView()
{
    $return = parent::actionView();

    if ($return instanceof XenForo_ControllerResponse_View)
    {
        $options = XenForo_Application::get('options');
        $return->params['commentHideTime'] = strtotime($options->z61_days . " days");
    }

    return $return;
}
 
  • Like
Reactions: Z61
Back
Top Bottom