Vanilla open source was terminated 1 January 2025 by Higher Logic. See this announcement for more information.
Using a variable defined in controller inside a view

Hey guys,
I come from using Laravel framework so using variables in a view are as easy as defining the variable in the controller and using it in the view.
But with Garden (vanilla) I'm having problems understanding how it works.
So in my controller I set a variable: $test = "testing var";
But when i try and do something like echo $test; in the view.. nothing shows up.
Can anyone guide me or tell me the logic behind this.
0
Comments
Welcome to the community!
There is a greater separation between controllers and views. Use the data methods to access information.
In the controller:
In the view:
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.