DroidHost
Well-known member
how to add variable to viewparams of the parent function ...
and how to access a vriable from the parent ....
this is my code
and how to access a vriable from the parent ....
this is my code
PHP:
class Demo_ControllerPublic_Forum extends XFCP_Demo_ControllerPublic_Forum
{
public function actionIndex()
{
$visitor = XenForo_Visitor::getInstance();
$visitorId = XenForo_Visitor::getUserId();
$forumId = $this->_input->filterSingle('node_id', XenForo_Input::UINT);
$ftpHelper = $this->getHelper('ForumThreadPost');
$forumFetchOptions = array('readUserId' => $visitor['user_id']);
$forum = $ftpHelper->assertForumValidAndViewable($forumId ? $forumId : $forumName, $forumFetchOptions);
$forumId = $forum['node_id'];
$response = parent::actionIndex();
if ($forumId == 2)
{
$mayname = 'ali';//array('mayname'=>'Ali');
//$this->getadv($response );
$response->params['myname'] = array();
$response->params['myname'] += $mayname;
//array array_merge('$params');
//array_push($params,('myname'=>'Ali') , "raspberry");
return $response;
}
else
{
return $this->responseNoPermission();
}
}
}