1. ctemplate advanced [from 1]
Modifier (modifier), the type of common variables (HTML, JS, or other), will undergo verification and encoding, for example, HTML type will convert & &. Types include HTML, pre, URL query, JavaScript, CSS, and JSON. If you find it difficult to define the template variables, you can use the Google: Template: gettemplatewithautoescaping () method to load the template, and use the automatic replacement mode to specify whether it is HTML, JS or CSS. You can write your own modifier to handle some special requirements.
Strip. The template contains some blank lines and blank characters. During loading, you can specify the parameter to determine whether to clear it. For example, Google: strip_blk_lines, Google: strip_whitespace.
Expandemitter, which has this interface in ctemplate. This interface is used to output data when the template is expanded. The stringemitter of STD: String version is implemented by default. After processing is completed, can be sent to the client, STD: String performance is not high. If you want an efficient web server, you can use the stream mode. For example, you can implement the expandemitter interface to stream data to the client browser.
Dictionary copy. If the two dictionaries are similar, copy a dictionary and modify it. Call dict-> makecopy ().
Reference
[1]Http://hi.baidu.com/duanmuchun/blog/item/eab82273b1a8861b8701b0bd.html