Smarty built-in function capture usage analysis, smartycapture
This example describes the Smarty built-in function capture usage. Share to everyone for your reference. The specific analysis is as follows:
{Capture} can capture the output within the tag range and coexist in the variable without displaying it. There are three ways to use it,
The code is as follows:
Copy the Code Code as follows: {Capture name= "banner"}aaaaaa{/capture}
{$smarty. Capture.banner}
{Capture assign= "foo"}bbbbbb{/capture}
{$foo}
{Capture append= "arr"}hello{/capture}
{Capture append= "arr"}world{/capture}
{foreach $arr as $value}
{$value}
{/foreach}
The first: {capture} uses the name attribute;
The second type: {capture} captures the content to the variable;
The third type: {capture} captures the contents into an array variable.
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/946754.html www.bkjia.com true http://www.bkjia.com/PHPjc/946754.html techarticle Smarty Built-in function capture usage analysis, Smartycapture This example describes the Smarty built-in function capture usage. Share to everyone for your reference. The specific analysis is as follows: {capture} can catch ...