Home  >  Article  >  php教程  >  关于html中{{}}中变量及步骤的疑惑

关于html中{{}}中变量及步骤的疑惑

WBOY
WBOYOriginal
2016-06-06 19:42:481622browse

关于html中{{}}中变量及方法的疑惑 我是一名网站美工,以前在学校是学过一些asp.net。现在公司的网站是php的,现在我想修改网站的一些功能,但是html中的代码实在让我疑惑,以前从没接触过这种类型。代码如下: {{includefile="header.html"}} {{if$cat.paren

关于html中{{}}中变量及方法的疑惑
我是一名网站美工,以前在学校是学过一些asp.net。现在公司的网站是php的,现在我想修改网站的一些功能,但是html中的代码实在让我疑惑,以前从没接触过这种类型。代码如下:


{{include file="header.html"}} 

{{if $cat.parentid>0}}

{{ffcategory catid=$cat.parentid to=cate}}

{{else}}

{{ffcategory catid=$cat.catid to=cate}}

{{/if}}





{{ffposition}}








  {{ffpagelist  field="jiaoling,address,price1,price2" to="datalist" order="`sort` asc,`create_time` desc"}}

 





    {{ffpagelist  pagesize=9 to="newsdata" field="zhichi,renshu,tgl" order="`sort` asc,`create_time` desc"}} 

                {{foreach from=$newsdata.info item=b key=k}}





  • {{$b.title}}

    {{$b.description}}







    关于html中{{}}中变量及步骤的疑惑







    支持分校



    {{$b.zhichi}}家





    教练人数



    {{$b.renshu}}名





    通过率



    {{$b.tgl}}%







  • {{/foreach}}





{{$newsdata.pages}}




{{include file="footer.html"}} 




我想知道{{}}中$b在哪定义的?方法与是从哪来的,整个代码都没交代吧
------解决思路----------------------
这是个模板文件,用户访问时会由与其对应的php文件读取这个模板文件,将其中的{{...}}替换成对应的php语句
{{...}}中的对象和变量也就替换成php中定义【本文来自鸿网互联 (http://www.68idc.cn)】的对象和变量了

------解决思路----------------------
引用:
Quote: 引用:

这是个模板文件,用户访问时会由与其对应的php文件读取这个模板文件,将其中的{{...}}替换成对应的php语句
{{...}}中的对象和变量也就替换成php中定义的对象和变量了

能够从这里看出对应的php文件在哪吗?

从模板文件中是看不出对应的php文件在哪的。

一般来说是在另外的目录中与模板文件同名或文件名类似的php文件。

------解决思路----------------------
你在该模板文件中加入
<script>document.write(location.href)</script>

就可知道该模板被谁使用了
------解决思路----------------------
这是php中的代码,我给你移动的php专区
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