Coding with SPIP 2.1
SPIP 2.1 Technical Documentation

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

  1. #VAL{This text will be returned}


Return a character using the PHP function chr:

  1. [(#VAL{91}|chr)] // [
  2. [(#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:

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