Example of condition judgment usage of the smarty template in php, and the smarty template. In php, the smarty template condition judgment usage example. The smarty template in this article describes the usage of the smarty template condition judgment in php. Share it with you for your reference. The specific implementation method is as follows: Use the smarty template condition judgment instance in Mod php, and the smarty Template
This article describes the usage of the smarty template condition judgment in php. Share it with you for your reference. The specific implementation method is as follows:
Template File test6.html code:
Smarty Test
{If $ cond = 1}
Condition is true |
{Else}
The condition is not true. |
{/If}
Php code:
<? Php require 'libs/Smarty. class. php '; // contains the Smarty class library file $ smarty = new Smarty; // creates a new Smarty object $ cond = 1; $ smarty-> assign ("cond ", $ cond); // assign a value to the variable in the template $ smarty-> display('test6.htm'); // display the page?>
I hope this article will help you with php programming.
Examples in this article describes the usage of the smarty template condition judgment in php. Share it with you for your reference. The specific implementation method is as follows: module...