新手问smarty的有关问题

WBOY
Release: 2016-06-13 10:11:35
Original
868 people have browsed it

新手问smarty的问题!
不知道大家还记得我拉 就是被领导喊去学PHP的 汇报一下情况 学了都快一个月了还是一脑子浆糊
关于smarty的问题:
知道有个模板文件 就是静态页面 然后要把需要动态的东西 都加进去,这个也能理解;
但是后面的步奏就不会了
是不是还需要另外的文件把动态的调用?还有需要配置么?该怎么学

------解决方案--------------------
smarty 是个模板引擎,静态页面把smarty 加进去后。需要php进行模板的加载。然后把php中对应的变量的value付给模板。然后在模板里面进行动态的调用。

不知道我说的你能听明白否!
------解决方案--------------------
建议去看看smarty手册。 网上都有相关例子,看看就明白了。
------解决方案--------------------
1、php中定义的变量$a;
2、将变量$a赋予模板变量AAA;
$smarty->assign("AAA",$a);
3、页面调用模板变量

{$AAA}

其中2步骤可能会在不同页面调用,只要认清这三部就K.O.了
------解决方案--------------------
小伙纸,你是想用smarty还是用uchome。uchome没有用smarty人家自己写的模板引擎。
smarty的大体用法官方提供了demos。这里也代搜了一个网址:
http://wenku.baidu.com/view/b884a1d428ea81c758f57804.html
http://www.beyond-x.net/?post=6
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!