A simple snippet that will return a value passed through a URL parameter. The Parameter is sanitized and kept below a set size.
Revolution makes it easy to pass URL parameters (i.e. [[~123? &p=`yes`]]). This snippet makes it simple to use that URL parameter.
name - The parameter name, defaults to "p"
int - (Opt) Set as true to only allow integer values
max - (Opt) The maximum length of the returned value, defaults to 20
default - (Opt) The value returned if no URL parameter is found
Example: [[getUrlParam? &name=`pageid` &int=`1`]]
Install with the Package Manager.
- First seen
- Supported databases
- Minimum MODX Requirement
|MODX.com||1.0-beta1||2010-10-29 (12 years ago)|
We've also seen 1 unverified versions of getUrlParam in use, but don't list those as we've been unable of confirming they are official releases from an official source.