Smarty built-in function capture usage analysis, smartycapture_PHP tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.