K
K
katerinavazhnenko2019-07-20 17:22:38
PHP
katerinavazhnenko, 2019-07-20 17:22:38

Is it possible in Smarty to output the value of a boolean expression without if?

Is there any way to shorten the expression:

{if $foo == "bar"}
    true
{else}
    false
{/if}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SerJook, 2019-07-21
@SerJook

{($foo == "bar")?'true':'false'}
or
{($foo=="bar")|var_export:true}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question