Smarty built-in function capture usage analysis, smartycapture. Smarty built-in function capture usage analysis, smartycapture this article describes the usage of the smarty built-in function capture. Share it with you for your reference. The specific analysis is as follows: {capture} can capture the usage analysis of the smarty built-in function capture, smartycapture
This example describes the usage of the smarty built-in function capture. Share it with you for your reference. The specific analysis is as follows:
{Capture} can capture the output content within the tag range and coexist in the variable without displaying it. There are three usage methods,
The code is as follows:
The code is as follows:
{Capture name = "banner"} aaaaaa {/capture}
{$ Smarty. capture. banner}
{Capture assign = "foo"} bbbbbbbb {/capture}
{$ Foo}
{Capture append = "arr"} hello {/capture}
{Capture append = "arr"} world {/capture}
{Foreach $ arr as $ value}
{$ Value}
{/Foreach}
First: {capture} uses the name attribute;
Second: {capture} captures the content to the variable;
Third: {capture} captures the content to the array variable.
I hope this article will help you with php programming.
The example in this article describes the usage of the smarty built-in function capture. Share it with you for your reference. The specific analysis is as follows: {capture} can capture...