<table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><th colspan="3" align="center">Smarty - the compiling PHP template engine</th></tr><tr><td width="25%" align="left" valign="bottom"><a href="smarty.for.programmers.html" accesskey="P">Prev</a></td><td width="50%" align="center" valign="bottom"/><td width="25%" align="right" valign="bottom"><a href="api.variables.html" accesskey="N">Next</a></td></tr></table> # Chapter 11. Constants 第十一章.常量 **Table of Contents[内容列表**][SMARTY_DIR](#) [Smarty目录] # SMARTY_DIR[Smarty目录] This is the full system path to the location of the Smarty class files. If this is not defined in your script,then Smarty will attempt to determine the appropriate value automatically. If defined, the path must end with a trailing slash/. 本常量为Smarty类文件绝对路径,如果未定义本变量,Smarty将尝试自行提供一个适当的值,如果为本变量提供了路径值,请在路径后加一个斜杠"/"。 <table width="100%" border="0" cellpadding="0" cellspacing="0" class="EXAMPLE"><tr><td><div class="EXAMPLE"><a name="AEN2833"/><b>Example 11-1. SMARTY_DIR</b><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="PROGRAMLISTING">&lt;?php// set path to Smarty directory *nix styledefine('SMARTY_DIR', '/usr/local/lib/php/Smarty-v.e.r/libs/');// path to Smarty windows styledefine('SMARTY_DIR', 'c:/webroot/libs/Smarty-v.e.r/libs/');// include the smarty class, note 'S' is upper caserequire_once(SMARTY_DIR . 'Smarty.class.php');?&gt;</pre></td></tr></table><p>参见<a href="language.variables.smarty.html#const">$smarty.const</a>和<a href="variable.php.handling.html">$php_handling</a>常量(?)。</p></div></td></tr></table> <table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td width="33%" align="left" valign="top"><a href="smarty.for.programmers.html" accesskey="P">Prev</a></td><td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">Home</a></td><td width="33%" align="right" valign="top"><a href="api.variables.html" accesskey="N">Next</a></td></tr><tr><td width="33%" align="left" valign="top">Smarty For Programmers<br/> 程序员篇</td> <td width="34%" align="center" valign="top"><a href="smarty.for.programmers.html" accesskey="U">Up</a></td><td width="33%" align="right" valign="top">Variables<br/>变量</td></tr></table>