I need a little help, I'm trying to switch to a twig темплате of standard php code. But something is wrong, although i read the template documentation well.
My Code
<?php echo $pr['price'] . ($pr['unit'] ? '/' . $pr['unit'] : ''); ?>
{{ pr.price . pr.unit ? '/' . pr.unit : '' }}
How do you think I can solve the problem with this one-line check, something wrong with the rules and the check?
In
twig
you use~
to concat strings, u'd also need to add parantheses, just like you did inphp
demo