Search code examples
variablessmarty

How to stop variables from showing output


I can't seem to find a way to stop the smarty variables from showing their output, i.e if i write {$foo} or {$foo++} it will show whatever the value of $foo is in the output.

Can anyone tell me how I can stop them from showing the output?


Solution

  • It's a core feature of Smarty to output the values of variables.

    If you don't want or like what's being displayed, you can

    • stop assigning variables to your smarty object from within PHP
    • comment the variable out like with {* $foo *}