#ENV{parameter}
– which we addressed in (
The #ENV environment) – retrieves environment variables passed into the template. A second argument is used to return a default value if the parameter requested does not exist in the environment or if its contents are empty.
#ENV{parameter, default value}
The parameter value retrieved is automatically filtered through
entites_html
, which converts the text into an HTML entity (a
<
character thereby becoming
<
). To avoid this conversion, we can apply an asterisk to the tag:
#ENV*{parameter, default value}
Finally, the
#ENV
tag just by itself returns a sequential table of all of the environment parameters.
Example
Retrieve an article identifier, otherwise the string "new":
Display all of the environment variables (useful for debugging):
[<pre>(#ENV**|unserialize|print_r{1})</pre>]