php中smarty模板条件判断用法实例_PHP教程
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Lepaskan: 2016-07-13 09:50:57
asal
809 orang telah melayarinya
php中smarty模板条件判断用法实例
模板文件test6.html代码:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
Smarty Test
{if $cond == 1}
条件成立 |
{else}
条件不成立 |
{/if}
|
php代码:
1
2
3
4
5
6
7
|
require 'libs/Smarty.class.php'; //包含Smarty类库文件
$smarty = new Smarty; //创建一个新的Smarty对象
$cond = 1;
$smarty->assign("cond",$cond); //对模版中的变量赋值
$smarty->display('test6.htm'); //显示页面
?>
|
http://www.bkjia.com/PHPjc/1015341.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1015341.htmlTechArticlephp中smarty模板条件判断用法实例 模板文件test6.html代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 html head titleSmarty Test/title /head body table width=200...
Kenyataan Laman Web ini
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn
Artikel terbaru oleh pengarang
-
2025-02-26 03:58:14
-
2025-02-26 03:38:10
-
2025-02-26 03:17:10
-
2025-02-26 02:49:09
-
2025-02-26 01:08:13
-
2025-02-26 00:46:10
-
2025-02-25 23:42:08
-
2025-02-25 22:50:13
-
2025-02-25 21:54:11
-
2025-02-25 20:45:11
Isu terkini
-
2025-03-21 13:39:34
-
2025-03-21 13:38:34
-
2025-03-21 13:37:19
-
2025-03-21 13:35:24
-
2025-03-21 13:34:32
Topik-topik yang berkaitan
Lagi>