Introduction - mod_ssi_func_rnd
This module provides a random function. It runs to two modes, a 'min-max' mode with number ranges, and an item mode, where variable is set from a list of items.
parameters
For min-max mode:
- min
- lower end of the range
- max
- upper end of the range
For item mode:
- item
- item to randomly use the value, this parameter would be used multiple times, see example
Result
A random number or an item value is returned.
Examples
Min-max mode:
The following would set the variable "0", "1" or "2" :
<!--#func var="rnd" func="random" min="0" max="2" -->
The following ranges can be used :
<!--#func var="rnd" func="random" min="-10" max="10" -->
<!--#func var="rnd" func="random" min="0" max="10" -->
<!--#func var="rnd" func="random" min="-50" max="-40" -->
Item mode
The following would set the variable "rnd" to "red" or "green" or
"blue" :
<!--#func var="rnd" func="random" item="red" item="green" item="blue" -->
Requirement
mod_ssi_func_flastmod requires mod_ssi_func as a parent function to be loaded to work.
The ordering of the parameters as set out in the examples is important, ordering these differently will result in the function not working.
|