Skip to content

Howto - php smarty hints

Just while you have to work with smarty, you need some small "how can i do this" hints.

  • php: if (is_a($object, 'myClass') | smarty: {if $object|is_a:'myClass'}
  • php: var_dump($item) | smary: {$item|@var_dump} - use "@" to make smarty run the modifier against the whole $item, otherwise it would use it for each element.
  • php: print_r($item) | smary: {$item|@print_r} - use "@" to make smarty run the modifier against the whole $item, otherwise it would use it for each element.

smarty.net functions