#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.

  1. #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 &lt;). To avoid this conversion, we can apply an asterisk to the tag:

  1. #ENV*{parameter, default value}

Finally, the #ENV tag just by itself returns a sequential table of all of the environment parameters.


Retrieve an article identifier, otherwise the string "new":

  1. #ENV{id_article,new}

Display all of the environment variables (useful for debugging):

  1. [<pre>(#ENV**|unserialize|print_r{1})</pre>]

Author Mark Baber Published : Updated : 29/05/10

Translations : English, français