updated doc to add arrays in the 'Literals' section

git-svn-id: http://svn.twig-project.org/trunk@164 93ef8e89-cb99-4229-a87c-7fa0fa45744b
This commit is contained in:
fabien
2009-12-13 12:29:34 +00:00
parent e4afc9fd7b
commit 7b003e86ec
+6 -1
View File
@@ -647,7 +647,8 @@ it.
### Literals
The simplest form of expressions are literals. Literals are representations
for PHP types such as strings and numbers. The following literals exist:
for PHP types such as strings, numbers, and arrays. The following literals
exist:
* `"Hello World"`: Everything between two double or single quotes is a
string. They are useful whenever you need a string in the template (for
@@ -658,6 +659,10 @@ for PHP types such as strings and numbers. The following literals exist:
writing the number down. If a dot is present the number is a float,
otherwise an integer.
* `[foo, bar]`: Arrays are defined by a sequence of expressions separated by
a comma (`,`) and wrapped with squared brackets (`[]`). As an array element
can be any valid expression, arrays can be nested.
### Math
Twig allows you to calculate with values. This is rarely useful in templates