From Smarty documentation (Smarty 3):
Although Smarty can handle some very complex expressions and syntax, it is a good rule of thumb to keep the template syntax minimal and focused on presentation. If you find your template syntax getting too complex, it may be a good idea to move the bits that do not deal explicitly with presentation to PHP by way of plugins or modifiers.
What they are basically suggesting is that you should keep the amount of logic in the templates down and use functions or modifiers instead. For simple cases you can use simple expressions as attribute values:
{assign var=test_var value=!empty($some_input)}
For more complex examples, you can write your own modifier:
function smarty_modifier_do_something_complex($input) {
// Process input and return value
}
and use it like this:
{assign var=test_var value=$some_input|do_something_complex}
Or you can stick with a more verbose {if} … {else} … {/if}
approach.