Hi Sweet People!
I've googled this, and found a solution with no explanation so I tested and came up with this example.
<head>
{$bloke = true}
{$sex = ($bloke) ? 'Male' : 'Female'}
</head>
After entering {debug} mode, I can see this returning 'Male' all right.
Top comments (3)
How do you like Smarty? I tried checking our their page but I'm currently on mobile and the site wasn't very mobile friendly - so I have no clue.
Hi, I have no choice, it's the decision of the company I work for. So I better master it. ;)
Thanks. I couldn't make it work in my template. Turned out parentheses are required in smarty:
(condition)
.