I am a bit confused with the $vars array. Is it an object e.g $vars['user']->guid ? also I have seen the variable used on any php script in the API as if all the scripts were included into one file so that the $vars array's values can be referred to from any script. Can someone please explain this I know it's a simple issue but I am new to the elgg framework. I would appreciate any form of help thanks.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Brett@brett.profitt
Brett - 0 likes
- Cash@costelloc
Cash - 0 likes
You must log in to post replies.In views, the $vars array is pre-populated with sometimes helpful stuff and by whatever the caller passes. $vars is only available in views. Here's the documentation for views, specifically how $vars works: http://docs.elgg.org/wiki/Views#Views_as_templates
Please note that we will be removing the "sometimes helpful stuff" in an upcoming version because it turns out to cause problems in some cases ($vars['user'], $vars['config'], $vars['url']).