| Recommend this page to a friend! |
| Packages of Rafa Rodriguez | Div PHP Template Engine | docs/Features/Conditional parts.md | Download |
|
|||||||||||||||||||||
One of the most commonly used functions in the GUI is to show or hide part of the interface. This is achieved with Div in various ways, and one of them is the use of the conditional parts. Some conditional on the template is defined by a block that begins and ends with the character question tag (?) or exclamation (!) otherwise, accompanied by a variable that must be a boolean value. For example, you can do this in the template:
If the value of "showproducts" is true, it shows the code between both tags. If the value is false or if you not pass the variable "showproducts", that part of code will be hidden. In general, the boolean value is defined by the method div::mixedBool, which takes into account the following criteria:
Syntax:
Example: index.php
index.tpl
Output
|