Iff Class¶
- class Iff¶
Represents an alt or opt block of conditional statements
If an
Iffsection containsElseeclauses it is rendered as analt(alternative) group, otherwise it is rendered as anopt(optional) group- __construct(string $condition)¶
Create a new Iff conditional group of statements
- Parameters:
$condition (
string) – The condition
- Returns:
A new instance of
Iff- Return type:
- addElse(Elsee ...$else)¶
Add Elsee group(s)
- addItem(ItemInterface ...$interface)¶
Add item(s)
- Parameters:
...$interface (
ItemInterface) – The item(s)
- Returns:
A new instance of
Anddwith the item(s) added- Return type:
- withComment(string $comment)¶
Sets a comment for the Iff
- Parameters:
$comment (
string) – The comment
- Returns:
A new instance of
Iffwith the comment- Return type:
- withElse(Elsee ...$else)¶
Set Elsee group(s)