mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-03 05:41:37 +01:00
1.2 KiB
1.2 KiB
Variables
Smarty has several types of variables. The type of the variable depends on what symbol it is prefixed or enclosed within.
- Variables assigned from PHP
- Variable scopes
- Variables loaded from config files
- {$smarty} reserved variable
Variables in Smarty can be either displayed directly or used as arguments for functions, attributes and modifiers, inside conditional expressions, etc. To print a variable, simply enclose it in the delimiters so that it is the only thing contained between them.
{$Name}
{$product.part_no} <b>{$product.description}</b>
{$Contacts[row].Phone}
<body bgcolor="{#bgcolor#}">
Note
An easy way to examine assigned Smarty variables is with the debugging console.