mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 19:36:43 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user