{bool 'name'} ... {/bool} works out a yes or no once and keeps it
under a name; the tag prints nothing. The content is read as an expression -
$stock gt 0, 1, $isAdmin and $active - and its truth
is the flag: blank content, 0 or a false comparison give FALSE, anything else
TRUE.
Later, {name} ... {/name} (or {bool:name} ...
{/bool:name} when the name is also something else) renders its content when the
flag is TRUE and its @else@ part when it is FALSE. In an expression the flag is
read with flag:name. The flag keeps the value it had when it was stored, even
when the variables in the expression change afterwards.
Without content, a second parameter gives the value: {bool 'open', $hours} -
the value's own truth by PHP's rule, so blank and '0' are FALSE and anything else
TRUE. A value is never run as template or expression. With neither content nor value the flag
is FALSE.
Under the strict syntax check a {bool} without a name, or with the name of a
built-in or application tag, is an error. For a test used once, {if} is
simpler; a flag pays off when the same test is asked in several places.