diff --git a/docs/en/designers/language-basic-syntax.xml b/docs/en/designers/language-basic-syntax.xml index 40ed75b3..5321b7bd 100644 --- a/docs/en/designers/language-basic-syntax.xml +++ b/docs/en/designers/language-basic-syntax.xml @@ -16,6 +16,7 @@ &designers.language-basic-syntax.language-syntax-comments; + &designers.language-basic-syntax.language-syntax-variables; &designers.language-basic-syntax.language-syntax-functions; &designers.language-basic-syntax.language-syntax-attributes; &designers.language-basic-syntax.language-syntax-quotes; diff --git a/docs/en/designers/language-basic-syntax/language-syntax-variables.xml b/docs/en/designers/language-basic-syntax/language-syntax-variables.xml new file mode 100644 index 00000000..e326c6c0 --- /dev/null +++ b/docs/en/designers/language-basic-syntax/language-syntax-variables.xml @@ -0,0 +1,49 @@ + + + + Variables + + Template variables start with a dollar sign. They can contain numbers, + letters and underscores, much like a PHP variable. You can reference arrays + that are indexed numerically or non-numerically. You can also reference + object properties and methods. Config file variables are an exception to the + dollar sign syntax. They can be referenced with surrounding hashmarks, or + with the special $smarty.config variable. + + + Variables + +bar} <-- display the object property "bar" +{$foo->bar()} <-- display the object method return value for "bar" +{#foo#} <-- display the config file variable "foo" +{$smarty.config.foo} <-- synonym for {#foo#} +{$foo[bar]} <-- syntax only valid in a section loop, see {section} +]]> + + + +