Smarty no:09 ldelim–rdelim-literal function of the life-Thunder Dog---

Source: Internet
Author: User
Tags html sample php sample code

Ldelim, Rdelim functions

Function: Output left and right separators

Basic syntax:

{Ldelim}

{Rdelim}

Demo4.php Sample code:

<? PHP require "Smarty/smarty. class. php "; $smarty New Smarty (); $title = ' Hello ', $smarty-Assign (' title ', $title), $smarty-and display ("demo4.html");

Demo4.html

<!DOCTYPE HTML><HTML><Head><MetaCharSet= ' utf-8′><title></title></Head><Body><H1>Test</H1><Div>The base identifier in Smarty is {}, and we can define it in the form of {Ldelim} $title {Rdelim} when defining a variable</Div></Body></HTML>

literal function

Function: The data in the literal label area will be treated as text, at which point the template ignores all character information inside it. This feature is used to display CSS or JavaScript scripts that may contain character information, such as curly braces. When this information is in the {literal}{/literal} tab, the template engine will not parse them and display them directly.

Demo4.html Sample code:

<!DOCTYPE HTML><HTML><Head><MetaCharSet= ' utf-8′><title></title>{literal}<styletype= "Css/text">H1{Color:Red;font-size:30px;}Div{Color:Blue;font-size:24px;}</style>{/literal}</Head><Body><H1>Test</H1><Div>Test</Div></Body></HTML>

Demo4.php Sample code:

<? PHP require "Smarty/smarty. class. php "; $smarty New Smarty (); $smarty , display ("demo4.html");

Smarty no:09 ldelim–rdelim-literal function of the life-Thunder Dog---

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.