阮一峰的IT笔记:首页 -> 分类 -> PHP 查看所有文章:按分类 | 按月份

Smarty的基本用法

<?php

// load Smarty library
require_once(SMARTY_DIR 'Smarty.class.php');

$smarty = new Smarty();

$smarty->template_dir '/web/www.example.com/smarty/guestbook/templates/';
$smarty->compile_dir '/web/www.example.com/smarty/guestbook/templates_c/';
$smarty->config_dir '/web/www.example.com/smarty/guestbook/configs/';
$smarty->cache_dir '/web/www.example.com/smarty/guestbook/cache/';

$smarty->assign('name','Ned');

$smarty->display('index.tpl');
?>

« Linux的四个组成部分 | 首页 | Smarty的基本语法 »

About

This page contains a single entry from the blog posted on 2007年01月11日 18:47.

The previous post in this blog was Linux的四个组成部分.

The next post in this blog is Smarty的基本语法.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33

Post a comment