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

Adding data to a response?

#1
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:

Mr. Goodie2Shoes

Well-known member
#2
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;
}