AndrewSimm
Well-known member
I am trying to add a count of articles into the stats of a user profile. I extended the class in the admin panel and I am trying to figure out how to make the variable available in the template. Basically, I am just trying to add to the viewAction of Members.
I have read the documents here but cannot seem to get it to work. When I use {$articles} in the template (using TMS) nothing shows. I get the title so I know my template modification is fine.
I have read the documents here but cannot seem to get it to work. When I use {$articles} in the template (using TMS) nothing shows. I get the title so I know my template modification is fine.
PHP:
namespace Andrew\Articles\XF\Pub\Controller;
use XF\Mvc\ParameterBag;
class Member extends XFCP_Member
{
public function actionArticleStats(ParameterBag $params) {
$reply = parent::actionView();
if ($reply instanceof \XF\Mvc\Reply\View)
{
$articles = 2;
$reply->setParam('articles', $articles);
}
return $reply;
}
}