#VAL

#VAL{value} is used to return the value passed as an argument. This tag is mainly used to send a first argument to some existing filters.

#VAL{This text will be returned}

Example

Return a character using the PHP function chr:

[(#VAL{91}|chr)]   // [
[(#VAL{93}|chr)]   // ]

Sometimes the SPIP compiler gets confused between the square brackets that we want to show as text characters, and the opening and closing square brackets used for our SPIP tags. A common example is sending a table parameter to a form (name="field[]"), when the field is included inside a loop:

// problem: the ] in the text field[] confuses the SPIP compiler
// with the closing of the #ENV tag
[(#ENV{afficher}|oui)
<input type="hidden" name="field[]" value="valeur" />
]
// no problem for the SPIP compiler with the code shown below
[(#ENV{afficher}|oui)
<input type="hidden" name="field[(#VAL{91}|chr)][(#VAL{93}|chr)]" value="valeur" />
]

Author Mark Baber Published : Updated : 12/03/23

Translations : English, Español, français