form_inflate
static
string
form_inflate
(
pTemplate
)
Inflate current form values into a template string.
You insert special tokens in the template string, and they will be replaced by the equivalent form field value.
Tokens are delimited by the percentage character ("%"), as such:
The name field value is: %name%
In this case, the token "%name%" will be replaced by the value in the form field whoseid is "name"
- Parameters:
-
pTemplate <string>
the string to inflate.
- Returns:
string
- the template string, with all tokens inflated.
non_null_string
static
string
non_null_string
(
pString
,
pDefault
)
Easy way to standardize strings; this function will return a default value if the input string is null.
- Parameters:
-
pString <string>
the string to test - or null. -
pDefault <string>
the default value to return, if the input string is, indeed, null.
- Returns:
string
- the input string if not null, or else the default value.
token_value
static
mized
token_value
(
pString
,
pTokenName
,
pTokenSeparator
,
pValueSeparator
,
pDefault
)
Get the value of a tokenized string.
- Parameters:
-
pString <string>
tokenized string. -
pTokenName <string>
name of the token to found. -
pTokenSeparator <string>
character or string used to separate the tokens from each other. -
pValueSeparator <string>
character or string used to separate the token name from its value. -
pDefault <mixed>
default value, if the token value is not found.
- Returns:
mized
- the value of the token, or the default value if the token does not exist in pString.