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