Home  >  Article  >  Backend Development  >  模板。该怎么解决

模板。该怎么解决

WBOY
WBOYOriginal
2016-06-13 13:51:57910browse

模板。。
今天看以前公司程序员的代码,用了模板(以前没接触过模板),html页面里有这样一句话: 我不明白{#feedbacklink#} 是如何被解析成地址的,我应该如何去理解呢?

------解决方案--------------------
用正则取出feedbacklink 拼上$ 成为变量 两边的{# #}被解析为
最终

------解决方案--------------------
比如:a是模板页面 b是PHP页面
然后B页面里有个函数 str_replace(“{被替换的内容}”,$替换的内容,$str);来解析a页面中
------解决方案--------------------
二楼上的就是 看看是不是有一个叫Smarty.class.php什么的

如果有再看下smarty手册



php ORM数据库类
http://topic.csdn.net/u/20100228/22/3bea834b-efc0-4aa0-af4a-a4923af8b60c.html

下载
http://code.google.com/p/queryphp/downloads/list 


------解决方案--------------------
{#feedbacklink#}是一个模板变量, 他必定有一个php变量$feedbacklink照应

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn