I want to have an if statement (or something that can do the following functionality) inside a include tag in smarty. I have the following include tag:
{include
file="controls/control_input.tpl"
//some other smarty variables
mask=$itemType->mask
mask=$field['mask']
}
my goal is to essentially have mask be set to itemType->mask if field["mask"] is = to "", otherwise it should be set to field["mask"]. However, I am unable to have a if statement inside the include tag it seems.
2
Answers
You can use if else condition inside include statement
You can use if else condition before including template file and then pass mask variable inside include tag like this,