Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

smarty shorthand if

// Besides true and false, you can also use 1 or 0
// You have to use brackets around the condition,
// even if its just a single var.

{($bloke) ? 'Male' : 'Female'}
 
PREVIOUS NEXT
Tagged: #smarty #shorthand
ADD COMMENT
Topic
Name
5+4 =