目录搜索
文字
分享

Basic Installation 基本安装

Install the Smarty library files which are in the /libs/ directory of the distribution. These are the PHP files that you SHOULD NOT edit. They are shared among all applications and they only get updated when you upgrade to a new version of Smarty.
安装Smarty发行版在/libs/目录里的库文件(就是解压了). 这些php文件你可不能乱画哦.这些文件被所有应用程序共享,也只能在你升级到新版的smarty的时候得到更新。

Example 2-1. Smarty library files
例 2-1.Smarty库文件

Smarty.class.php
Smarty_Compiler.class.php
Config_File.class.php
debug.tpl
/core
$smarty->register_block("translate", "do_translation");

function do_translation ($params, $content, &$smarty, &$repeat) {
if (isset($content)) {
$lang = $params['lang'];
// do some translation with $content
return $translation;
}
}

{* template *}
{translate lang="br"}
Hello, world!
{/translate}
上一篇:要求下一篇:扩展设置