Parameters to pass to the container view in responseReroute

infis

Well-known member
#1
Where and how I can use third parameter in responseReroute?

For example, I use in actionIndex this as:
Code:
return $this->responseReroute(__CLASS__, 'member', array('uid' => $uid));
But in actionMember I can't use any parameters. And $this->_input->filterSingle('uid', XenForo_Input::UINT) not return this also.
 

Chris D

XenForo developer
Staff member
#2
The third parameter sets the container params in the controller response. Container params will be available in the PAGE_CONTAINER template. You can also access them in _postDispatch, e.g.

PHP:
$controllerResponse->containerParams['uid']
I don't think you can access them from the controller action directly. But you can in theory access them by listening to the controller_post_dispatch event.

I think what you probably want to do is this:

PHP:
$this->_request->setParam('uid', $uid);
return $this->responseReroute(__CLASS__, 'member');
PHP:
public function actionMember()
{
    $uid = $this->_input->filterSingle('uid', XenForo_Input::UINT); // Contains the $uid param set in the request.
}
 

infis

Well-known member
#3
I think what you probably want to do is this:

PHP:
$this->_request->setParam('uid', $uid);
return $this->responseReroute(__CLASS__, 'member');
PHP:
public function actionMember()
{
    $uid = $this->_input->filterSingle('uid', XenForo_Input::UINT); // Contains the $uid param set in the request.
}
Thank you! This example is help me. Method setParam is solved my problem.
 
Top