Smarty built-in function capture usage analysis, smartycapture_php tutorial

Source: Internet
Author: User

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 ...

  • 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.