Variable from ControllerPublic to template

  • Thread starter Thread starter account8226
  • Start date Start date
A

account8226

Guest
Hello,

I am trying to send out a variable I have in ControllerPublic (actionIndex) to a template I made.

How can I do this ?

Between, have you got any good xenforo tuts to starts developing add-ons ?

Regards.
 
Have you returned a response? In the controller, you'll pass something like:
PHP:
return $this->responseView('XenForo_ViewPublic_Forum_View', 'forum_view', $viewParams);

Your $viewParams are the variables exposed to the template, where "forum_view" is your template.
 
Have you returned a response? In the controller, you'll pass something like:
PHP:
return $this->responseView('XenForo_ViewPublic_Forum_View', 'forum_view', $viewParams);

Your $viewParams are the variables exposed to the template, where "forum_view" is your template.

Yes I did, here is my view params :
Code:
$viewParams = array(
                '1' => "Hey",
                'id' => $var
            );
 
Top Bottom