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

Having issues editing response parameters in 1.2rc1...

Jaxel

Well-known member
#1
Okay, so lets say I have the following function:
Code:
<?php

class EWRporta_ControllerPublic_Index extends XFCP_EWRporta_ControllerPublic_Index
{
    public function actionIndex()
    {
        $response = parent::actionIndex();
   
            $response->params['layout1'] = 'index';
            $response->params['layout2'] = 'portal';

        return $response;
    }
}
Its simple, it adds two parameters to the parameters of the /index page. This worked perfectly fine in previous version of XenForo. However, now it does not. Those parameters are no longer set when I try to access them in my ViewPublic. How do I set these parameters now?
Code:
<?php

class EWRporta_ViewPublic_Custom extends XFCP_EWRporta_ViewPublic_Custom
{
    public function renderHtml()
    {
        if (empty($this->_params['layout1']))
        {
            echo "NO LAYOUT GIVEN"; exit;
        }
    }
}
In fact, if I add the following check to the ControllerPublic, it doesnt fire anymore:
Code:
if ($response instanceof XenForo_ControllerResponse_View)
{
    echo "IS INSTANCEOF VIEW"; exit;
}
 
Last edited:

Jeremy

Well-known member
#2
Did the Index controller not change in 1.2?

Yup, it now reroutes to whatever you set in your ACP options for the Index controller (route). Will most likely need to do some extra work in your listener to extend the correct class.