diff options
| author | Greg Kaleka <greg@gregkaleka.com> | 2018-07-03 17:16:52 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-07-03 20:17:06 -0400 |
| commit | 82c38be11fa55711c3ad7f551502ba827cb27f33 (patch) | |
| tree | aba9c30ebe26caea4b7e4e5379afe16a4770eca8 /docs | |
| parent | ec0b74a1de789525319880b390e9966da389aef1 (diff) | |
[2.1.x] Doc'd that template variables & attributes may not start with an underscore.
Backport of 17403f0a9b7167c635514c1e3d9d25ebad4b12e2 from master
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/templates/language.txt | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/docs/ref/templates/language.txt b/docs/ref/templates/language.txt index c6ce3b3dfd..a10cfde03b 100644 --- a/docs/ref/templates/language.txt +++ b/docs/ref/templates/language.txt @@ -82,10 +82,10 @@ Variables Variables look like this: ``{{ variable }}``. When the template engine encounters a variable, it evaluates that variable and replaces it with the result. Variable names consist of any combination of alphanumeric characters -and the underscore (``"_"``). The dot (``"."``) also appears in variable -sections, although that has a special meaning, as indicated below. -Importantly, *you cannot have spaces or punctuation characters in variable -names.* +and the underscore (``"_"``) but may not start with an underscore. The dot +(``"."``) also appears in variable sections, although that has a special +meaning, as indicated below. Importantly, *you cannot have spaces or +punctuation characters in variable names.* Use a dot (``.``) to access attributes of a variable. @@ -124,6 +124,9 @@ Note that "bar" in a template expression like ``{{ foo.bar }}`` will be interpreted as a literal string and not using the value of the variable "bar", if one exists in the template context. +Variable attributes that begin with an underscore may not be accessed as +they're generally considered private. + Filters ======= |
