Smarty

来自开放百科 - 灰狐
2010年11月12日 (五) 13:32Allen (讨论 | 贡献)的版本

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转到: 导航, 搜索
Wikipedia-35x35.png 您可以在Wikipedia上了解到此条目的英文信息 Smarty Thanks, Wikipedia.
Smarty icon.gif

Smarty : PHP Template Engine

Start

templates\index.tpl

{* Smarty *}
Hello, {$name}!

hello.php

<?php
require('C:/wamp/www/smarty/Smarty.class.php'); // Windows
require('/usr/local/lib/php/Smarty/Smarty.class.php'); // Linux
$smarty = new Smarty;
$smarty->template_dir = 'templates/';
$smarty->compile_dir = 'templates_c/';
$smarty->config_dir = 'configs/';
$smarty->cache_dir = 'cache/';
$smarty->assign('name','Smarty');
$smarty->display('index.tpl');
?>

Links

Comment-32x32.png

<discussion>characters_max=300</discussion>

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱