PHP solutions to conflicts with Css/json in the regular template engine _php tips

Source: Internet
Author: User

This article describes the PHP for the regular template engine and Css/json conflict resolution, has a certain practical value, the specific analysis is as follows:

This article mainly aims at the object for Smarty and Dwoo

In Smarty, there is often a situation where there is a conflict with the CSS/JS syntax, because both require braces {}. Although you can change the smarty definition, it is not cost-effective to modify all the relevant code in an existing system. The workaround is as follows:

1. Avoid simultaneous occurrence

avoided by means of external references. The problem is to avoid the absence of shelter. So this situation is only suitable for a few simple situations.

2. Modify the Smarty definition character

3. You can surround style sheet information with the Smarty literal tag , as follows:

 

In contrast, the third method is undoubtedly green, in the face of conflict, plus literal tag package.

The scheme is also effective for dwoo engines.

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.