In php, the smarty region loop method is called phpsmarty region loop. The method of smarty region loop in php. the example in 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: The smarty area loop method in html php, and the phpsmarty area loop
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:
Smarty Test
{foreach key=key1 item=item1 from=$array1}
{$key1} |
{$item1} |
{/foreach}
<? Php require 'libs/Smarty. class. php '; // contains the Smarty class library file $ smarty = new Smarty; // creates a new Smarty object $ array1 = array (1 => "Simon ", 2 => "elasticity", 3 => "Susan"); // defines the array $ smarty-> assign ("array1", $ array1 ); // assign a value to the variable $ smarty-> display('test3.htm') in the template; // display the page?>
Another method:
Smarty Test
{section name=section1 loop=$array1}
{$array1[section1]} |
{/section}
<? Php require 'libs/Smarty. class. php '; // contains the Smarty class library file $ smarty = new Smarty; // creates a new Smarty object $ array1 = array (0 => "Simon ", 1 => "elasticity", 2 => "Susan"); // defines the array $ smarty-> assign ("array1", $ array1 ); // assign a value to the variable $ smarty-> display('test10.htm') in the template; // display the page?>
I hope this article will help you with php programming.
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: html...