What is Smarty?
Why use it?
Use Cases and Work Flow
Syntax Comparison
Template Inheritance
Best Practices
Crash Course
You may use the Smarty logo according to the trademark notice.
For sponsorship, advertising, news or other inquiries, contact us at:
Smarty puede reconocer variables asignadas entre comillas aunque estas solo tengan números, letras, guiones bajos y corchetes[]. Con cualquier otro carácter(puntos, referencia de objetos, etc.) las variables deben estar entre apostrofos. Usted no puede incrustar modificadores, Estos deben ser siempre aplicados fuera de las comillas.
Example 3.5. Sintaxis entre comillas
SYNTAX EXAMPLES: {func var="test $foo test"} <-- sees $foo {func var="test $foo_bar test"} <-- sees $foo_bar {func var="test $foo[0] test"} <-- sees $foo[0] {func var="test $foo[bar] test"} <-- sees $foo[bar] {func var="test $foo.bar test"} <-- sees $foo (not $foo.bar) {func var="test `$foo.bar` test"} <-- sees $foo.bar {func var="test `$foo.bar` test"|escape} <-- modifiers outside quotes! PRACTICAL EXAMPLES: {include file="subdir/$tpl_name.tpl"} <-- will replace $tpl_name with value {cycle values="one,two,`$smarty.config.myval`"} <-- must have backticks
Ver también escape.