This is usually because of the smarty boundary character other program conflicts, at which point the solution has three
1. External chain related documents. such as the CCS style sheet, the link outside the chain cascading style sheet files. For example:
1 <link href= "style.css" type= "Text/css" rel= "stylesheet"/>
2. Use the literal tag. Using Smarty's unique literal tag to differentiate between areas that do not need to be resolved, the area Smarty that is included with the tag {literal} and {/literal} will skip parsing direct output, which will not result in a conflict.
The code is as follows |
Copy Code |
{literal} <style type= "Text/css" > Body { Color: #FFF; } </style> {/literal} |
3. Modify the default delimiter for Smarty. This is done by setting the Left_delimiter and Right_delimiter properties.
The code is as follows |
Copy Code |
Require ("Smarty.class.php"); $template = new Smarty; $template->left_delimiter = ' <{'; $template->right_delimiter = '}> ';
|
The disadvantage of the 3rd method is to change the original template parsing label, more trouble, recommend the 1th and the 2nd flexible combination of use.