Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Using a variable defined in controller inside a view
odannyc
New
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.