主要针对对象:Smarty/Dwoo参考:http://developer.51cto.com/art/201009/224929.htm其实以前都不怎么关注模板引擎,觉得没必要使用。但随着年龄的增加,代码洁癖越来越严重,才开始碰到这个问题。Smarty和CSS/JS的语法存在冲突,因为二者都需要使...
分类:
Web程序 时间:
2014-09-25 19:09:37
阅读次数:
209
Smarty3 第一天By 飞鸿影~2014-9-23 21:46:38 1、什么是smarty? Smarty是采用php写的一个模版引擎,设计的目的是要将php代码与html代码分离, 使php程序员只专注于php代码的编写,网页美工只专注于网页的美化 2、采用模版引擎后: 1)php...
分类:
其他好文 时间:
2014-09-24 01:03:55
阅读次数:
205
文件位置ECSHOP根目录\includes\init.php在$smarty->assign(‘ecs_charset‘,EC_CHARSET);下面增加$smarty->assign(‘template_dir‘,‘themes/‘.$_CFG[‘template‘]);在模板中就直接调用可以参考下面的css调用的方法:if(!empty($_CFG[‘stylename‘])){$smarty->assign(‘ecs..
分类:
其他好文 时间:
2014-09-05 14:31:02
阅读次数:
204
ecshop是smarty的改版,删除了一些功能,比如模板中的四则运算被删除了,比如我们想通过运算得到循环的key+1这样是得不到他的值的,不过我们可以使用其他的方法来得到。
.iteration
iteration contains the current loop iteration and always starts at one, unlike
index It is inc...
分类:
其他好文 时间:
2014-09-04 22:23:30
阅读次数:
424
{literal}{/literal}===============================================================================Literal 标签区域内的数据将被当作文本处理,此时模板将忽略其内部的所有字符信息. 该特性用于显示有...
分类:
其他好文 时间:
2014-08-30 22:53:20
阅读次数:
340
首先这是一个大概4年前做的PHP项目,使用的是Zend Framework 1 + Smarty 2 , 已经很多年没有动过了, 最近抽风了,把这个项目要玩改版。拿出来改改吧。 ZF 升级2这事,还是再考虑一下。毕竟项目结构要改变。 Smarty由2升级为3还是可以考虑一下。 下载最新版Smarty...
分类:
其他好文 时间:
2014-08-26 17:02:47
阅读次数:
156
大家都知道PHP中输出时间和日期可以用 date("Y-m-d H:i:s",时间戳) , 但是在smarty模板中,$time|date_format:'%Y-%m-%d %H:%M:%S', 这个让我找了很久。原来 在smarty中,分钟 不是用i ,使用M 。留着做记号。
分类:
其他好文 时间:
2014-08-25 11:48:04
阅读次数:
168
代码如下:$smarty = new Smarty; $smarty->assign('yesterday', strtotime('-1 day')); $smarty->display('index.tpl'); index.tpl: {$smarty.now|date_format} {$sm...
分类:
其他好文 时间:
2014-08-22 12:22:36
阅读次数:
218
assign('name','Linux');$smarty->assign('title','在线有有要有和蔼是是非非要要');$smarty->assign('english_word','my name x4 is linux');$smarty->assign('money','344.22...
分类:
其他好文 时间:
2014-08-22 12:13:36
阅读次数:
215
//php 控制器文件'12333','a2'=>'2222222','a3'=>'333333','a4'=>'3333333');$smarty->assign($qq_numbers);$smarty->assign('title','这是我的QQ号码');$smarty->assign('c...
分类:
其他好文 时间:
2014-08-22 12:08:16
阅读次数:
131