最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
smarty 模板if else使用实例与入门教程
时间:2010-04-27 编辑:简简单单 来源:一聚教程网
smarty 模板if else使用实例与入门教程
smarty 主要功能是完成美工与程序分离,并且使用的缓存技术,减轻服务器的负载,
smarty 以在文件中放置特殊的“Smarty标签”来产生网页内容。这些标签会被处理并替换成其他的内容。
*/
require('smarty/libs/Smarty.class.php教程');
$tpl = new Smarty();
$tpl->template_dir = 'd/'
$tpl->compile_dir = 'd/template_c';
$tpl->compile_check = false;//$cfg['debug'];
$tpl->debugging = false;
$tpl->caching = false;
$tpl->cache_lifetime = 3600;
$tpl->left_delimiter = '';
$array = 'www.111com.net'
$tpl->assign('dataList', $array);
$tpl->display('a.tpl');
/*
a.tpl
echo 'aaa';
还有另一种方法
{if $name eq 'Fred'}
Welcome Sir.
{elseif $name eq 'Wilma'}
Welcome Ma'am.
{else}
Welcome, whatever you are.
{/if}
{* an example with "or" logic *}
{if $name eq 'Fred' or $name eq 'Wilma'}
...
{/if}
本文章原创于www.111com.net转载注明出处
-
上一个: 站内搜索关键词变亮方法
-
下一个: php 新闻文章分页代码实例教程
相关文章
- mybatis基本实例详解 08-03
- C语言 makefile学习及实现实例 08-01
- ps玻璃杯子制作实例 07-26
- Python编程之event对象的用法实例分析 07-20
- 详解Java CountDownLatch完成异步回调实例 07-18
- 数码单反怎么摄影 数码单反实例教程 07-13