I’m new to Modx, but very comfortable with PHP and Javascript. i’d like to modify one of the available snippets, and i understand the scripting part, but i am somehow missing the link between the parameters in the snippet call and the script. Can someone point me to an explanation of how the (& params ) in a snippet call are linked to the PHP script?
thanks much!
Parameters are way to set variables in PHP.
So if I had a snippet call that looked like this:
[[Snippet? ¶m1=`Hello`]] and the php code looked like this:
The output would be "Hello"
Hope that helps.
Jesse R.
Consider trying something new and extraordinary.
Illinois Wine
Have you considered donating to MODx lately?
Donate now. Every contribution helps.
-
☆ A M B ☆
- 24,524 Posts
Bottom line is, any ¶m parameters in either the snippet call or in the snippet’s configuration tab will be automatically available in your snippet as a simple $param variable.