Resolution of Conflicts with CSS/JSON in the common PHP template engine

Source: Internet
Author: User
Tags php template
For more information about the target objects: SmartyDwoo, see. 51cto.comart201009224929.htm. In fact, I didn't pay much attention to the template engine in the past and thought it was unnecessary to use it. But with the increase of age, code cleansing becomes more and more serious, and this problem begins to emerge. There is a conflict between the syntax of Smarty and CSSJS, because both of them need to use

Mainly for objects: Smarty/Dwoo reference: http://developer.51cto.com/art/201009/224929.htm in the past are not very concerned about the template engine, I think there is no need to use. But with the increase of age, code cleansing becomes more and more serious, and this problem begins to emerge. There is a conflict between the syntax of Smarty and CSS/JS, because both of them need to use

Target objects: Smarty/Dwoo

Reference: http://developer.51cto.com/art/201009/224929.htm

In fact, we didn't pay much attention to the template engine in the past and thought it was unnecessary to use it. But with the increase of age, code cleansing becomes more and more serious, and this problem begins to emerge.

There is a conflict between the syntax of Smarty and CSS/JS, because both must use braces {}. Although you can change the definition of Smarty, it is not cost-effective to modify all the relevant code in an existing system.

1.Avoid simultaneous appearance

Avoid using external references. The problem is that it is unavoidable. Therefore, this situation is only suitable for a few simple cases.

2. Modify the Smarty identifier

2.Use the literal tag of Smarty to enclose the Style Sheet Information

  {$title} {literal}  
 
   p{  margin::2px  }   {/literal}   
 

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.