Smarty

Article Topics: Smarty

Smarty is a templating engine used by several Too Much Media products.

PHP Parsing

The Smarty templates in NATS are not parsed by PHP for security reasons. In NATS, you can enable linkcodes by changing links from,

?<?=(!empty($_REQUEST['nats']) && !preg_match('/[\'\"<>()\\\+\[\]]/', $_REQUEST['nats']))?'&nats='.$_REQUEST['nats']:''?>

to,

?nats={$nats_code}

In NATS, you can use the nats_encode or nats_list_linkcodes functions.

Inline JavaScript & CSS

Place inline JavaScript or CSS between Smarty's {literal} and {/literal} tags.

Smart Print Array

To list array values in smarty templates:

{$var|@debug_print_var}

This will print out the values of Smarty array $var, similar to using print_r in php.

See Also

Last updated

Was this helpful?