The smarty area loop method in php. The method of smarty region loop in php this article describes the method of smarty region loop in php. Share it with you for your reference. The specific implementation method is as follows: 1234567891011121 the smarty area loop method in php
This article describes how to cycle the smarty area in php. Share it with you for your reference. The specific implementation method is as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Smarty Test {Foreach key = key1 item = item1 from = $ array1} {/Foreach}
|
1 2 3 4 5 6 7 |
Require 'libs/Smarty. class. php'; // contains the Smarty class library file $ Smarty = new Smarty; // create a new Smarty object $ Array1 = array (1 => "Simon", 2 => "Elaine", 3 => "Susan"); // define an array $ Smarty-> assign ("array1", $ array1); // assign values to variables in the template $ Smarty-> display('test3.htm'); // Display Page ?> |
Another method:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Smarty Test {Section name = section1 loop = $ array1} {/Section}
|
1 2 3 4 5 6 7 |
Require 'libs/Smarty. class. php'; // contains the Smarty class library file $ Smarty = new Smarty; // create a new Smarty object $ Array1 = array (0 => "Simon", 1 => "Elaine", 2 => "Susan"); // define an array $ Smarty-> assign ("array1", $ array1); // assign values to variables in the template $ Smarty-> display('test10.htm'); // Display Page ?> |
Examples in this article describes how to cycle the smarty area in php. Share it with you for your reference. The specific implementation method is as follows: 1 2 3 4 5 6 7 8 9 10 11 12 1...