Prev |  | Next

#### 1.4.3.2. Strings

Strings are sequences of characters within quotes (both double and single quotes can be used).

Example 1.5. String values

    "this is a string value"
    "My 1st string!"
    'Single quoted string is possible too'

Now if you need the quote which you used to surround the string with inside the string itself, you must escape it using \" or \'. This is consistent with the way that PHP strings are escaped.

Example 1.6. Escaped quotes in string values

    "this is a \"string\" value"
    'Single quoted \'string\' value'
    "You can use both \" and ' for strings!"

Here are some examples of template code in which strings are used:

Example 1.7. Code using string values

    {VAR QUESTION "Do you know what \"fubar\" means?"}
    {VAR CORRECT "That was the right answer!"}
    {VAR INCORRECT "No.. you were wrong!"}

    {IF ANSWER 'Fucked Up Beyond All Recognition'}
      {CORRECT}
    {ELSE}
      {INCORRECT}
    {/IF}

Prev | Up | Next
| Home |