Smarty variable adjuster (Linux pipeline)

Source: Internet
Author: User

Variable adjuster: The input of the former is the output of the latter

That is, the function uses

<{Variable | Function method name}>

Variables are here as arguments to the function

Output is the result of the execution

function instance (variable adjuster)


{$name}<br/>

{$name |lower} <br/>{* convert the variable string to lowercase *}

{$name |upper} <br/>{* uppercase conversion *}

{$content}<br/>

{$content |truncate:18}<br/>{* to intercept the content, the kanji is also a character *}

{$smarty. now}<br/>

{$smarty. now|date_format}<br/>{* Time format display *}

{$smarty. Now|date_format: "%a"}<br/>{* Week simple format display *}

{$smarty. Now|date_format: "%A"}<br/>{* Week full format display *}

{$smarty. Now|date_format: "%y-%m-%d%h:%m:%s"}<br/>{* time format display *}

{$name |cat: "-huashengdun": "-bushi"}<br/>{* connection String *}

{$name |count_characters}<br/>{* calculates the number of target characters (Chinese characters are single-character calculations) *}

{$title |count_paragraphs}<br/>{* count the number of paragraphs \ r \ n, physical paragraph *}

{$study |count_sentences}<br/>{* the number of sentences inside the calculation paragraph (. Is the end of Chinese)?), there is a carriage return ending *}

{$dog |escape} <br/>{* convert the HTML code inside the content to the symbol entity *}

{$content |indent:6: ' # '}<br/>{* to display indentation for content, 4 spaces by default *}

{$content |nl2br}<br/>{* to convert the contents of the physical line to < BR/>*}

{$name |regex_replace: "/[a-za-z]+/": "Bush"} {*regex_replace Replace the content with a regular replacement *}

  

Smarty variable adjuster (Linux pipeline)

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.