From: fabien Date: Sun, 13 Dec 2009 12:29:34 +0000 (+0000) Subject: updated doc to add arrays in the 'Literals' section X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=7b003e86ecaf1d0e1fff2fee0aa43b0afbbf37ee;p=konrad%2Ftwig.git updated doc to add arrays in the 'Literals' section git-svn-id: http://svn.twig-project.org/trunk@164 93ef8e89-cb99-4229-a87c-7fa0fa45744b --- diff --git a/doc/02-Twig-for-Template-Designers.markdown b/doc/02-Twig-for-Template-Designers.markdown index 1e01190..cc9b3dd 100644 --- a/doc/02-Twig-for-Template-Designers.markdown +++ b/doc/02-Twig-for-Template-Designers.markdown @@ -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