Gossamer
Active member
I've been trying to wrap my head around this, but I'm having trouble extending the ControllerPublic_Thread so that I can pull a variable into a post.
I have subaccounts installed on my forum and I'm creating an addon to display the parent account, if it exists, on the member card, the member info page, and the user info next to posts. It's the last one I'm having trouble with.
This is the code I've used for the member info page, for reference:
I'm trying to figure out how to extend ControllerPublic_Thread so I can fetch the $user of a post and pass it into my getParentAccount function. I've looked at a few addons to try and figure out how it was done elsewhere, but I can't seem to wrap my head around how the code digs from thread->post->user.
Any help would be greatly appreciated.
I have subaccounts installed on my forum and I'm creating an addon to display the parent account, if it exists, on the member card, the member info page, and the user info next to posts. It's the last one I'm having trouble with.
This is the code I've used for the member info page, for reference:
PHP:
public function actionIndex()
{
$subModel = $this->_getSubModel();
$response = parent::actionIndex();
$response->params += array(
'parent' => $subModel->getParentAccount($userId),
'parentExists' => $subModel->ParentAccountExists($userId),
);
return $response;
}
I'm trying to figure out how to extend ControllerPublic_Thread so I can fetch the $user of a post and pass it into my getParentAccount function. I've looked at a few addons to try and figure out how it was done elsewhere, but I can't seem to wrap my head around how the code digs from thread->post->user.
Any help would be greatly appreciated.