Get Smarty

Donate

Paypal

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Sites Using Smarty

Advertisement

Colocando variables entre comillas dobles

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.

Comments
No comments for this page.

Advertisement

Sponsors [info]

Sponsors