Skip to content
Myr

Merge pull request #274 from thomasballinger/fix-1

Before adoption: this commit came in with the history the project adopted, so no landing records it.

docfixes in Variables section of templates.rst

authored by Armin Ronacher · committed by Armin Ronacher · parents 0d52d72, f30ab12 · Browse files · 1 file+10 added−10 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+10 added−10 removed

  • other:+10 added−10 removed

1 file+10 added−10 removed

modified:docs/templates.rst+10 added-10 removed
51 unmodified lines
5253Variables54---------5556The application passes variables to the templates you can mess around in the57template. Variables may have attributes or elements on them you can access58too. How a variable looks like, heavily depends on the application providing59those.56You can mess around with the variables in templates provided they are passed in57by the application. Variables may have attributes or elements on them you can58access too. What attributes a variable has depends heavily on the application59providing that variable.6061You can use a dot (``.``) to access attributes of a variable, alternative the62so-called "subscript" syntax (``[]``) can be used. The following lines do63the same::61You can use a dot (``.``) to access attributes of a variable, but alternatively62the so-called "subscript" syntax (``[]``) can be used. The following lines do63the same thing::6465 {{ foo.bar }}66 {{ foo['bar'] }}6768It's important to know that the curly braces are *not* part of the variable68It's important to know that the curly braces are *not* part of the variable,69but the print statement. If you access variables inside tags don't put the70braces around.70braces around them.7172If a variable or attribute does not exist you will get back an undefined73value. What you can do with that kind of value depends on the application74configuration, the default behavior is that it evaluates to an empty string74configuration: the default behavior is that it evaluates to an empty string75if printed and that you can iterate over it, but every other operation fails.7677.. _notes-on-subscriptions:78
1357 unmodified lines