Empty

empty — Returns true if var does not exist or has a value that is empty or equal to zero, aka falsey, see conversion to boolean. Otherwise returns false..

Basic Usage:
Empty Check:
{if $myVar is empty}it's an empty variable{/if}
{if $myVar|empty}it's an empty variable{/if}
{if empty($myVar)}it's an empty variable{/if}
Not empty Check:
{if $myVar is not empty}it's an not empty variable{/if}
{if $myVar|empty:'!'}it's an not empty variable{/if}
{if !empty($myVar)}it's an not empty variable{/if}
Was this article helpful?