<HTML ><HEAD ><TITLE >Constants</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK REL="HOME" TITLE="Smarty Manual" HREF="index.html"><LINK REL="UP" TITLE="Smarty For Programmers" HREF="smarty.for.programmers.html"><LINK REL="PREVIOUS" TITLE="Smarty For Programmers" HREF="smarty.for.programmers.html"><LINK REL="NEXT" TITLE="SMARTY_CORE_DIR" HREF="constant.smarty.core.dir.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ISO-8859-1"></HEAD ><BODY CLASS="chapter" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Smarty Manual</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="smarty.for.programmers.html" ACCESSKEY="P" >Prev</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="constant.smarty.core.dir.html" ACCESSKEY="N" >Next</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="chapter" ><H1 ><A NAME="smarty.constants" ></A >Chapter 11. Constants</H1 ><DIV CLASS="TOC" ><DL ><DT ><B >Table of Contents</B ></DT ><DT ><A HREF="smarty.constants.html#constant.smarty.dir" >SMARTY_DIR</A ></DT ><DT ><A HREF="constant.smarty.core.dir.html" >SMARTY_CORE_DIR</A ></DT ></DL ></DIV ><DIV CLASS="sect1" ><H1 CLASS="sect1" ><A NAME="constant.smarty.dir" ></A >SMARTY_DIR</H1 ><P > This is the <SPAN CLASS="bold" ><B CLASS="emphasis" >full system path</B ></SPAN > 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 <SPAN CLASS="bold" ><B CLASS="emphasis" >must end with a trailing slash/</B ></SPAN >. </P ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN4773" ></A ><P ><B >Example 11-1. SMARTY_DIR</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /></span><span style="color: #FF8000">// set path to Smarty directory *nix style<br /></span><span style="color: #0000BB">define</span><span style="color: #007700">(</span><span style="color: #DD0000">'SMARTY_DIR'</span><span style="color: #007700">, </span><span style="color: #DD0000">'/usr/local/lib/php/Smarty-v.e.r/libs/'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// path to Smarty windows style<br /></span><span style="color: #0000BB">define</span><span style="color: #007700">(</span><span style="color: #DD0000">'SMARTY_DIR'</span><span style="color: #007700">, </span><span style="color: #DD0000">'c:/webroot/libs/Smarty-v.e.r/libs/'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">// include the smarty class, note 'S' is upper case<br /></span><span style="color: #007700">require_once(</span><span style="color: #0000BB">SMARTY_DIR </span><span style="color: #007700">. </span><span style="color: #DD0000">'Smarty.class.php'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?></span> </span> </code></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE ><P > See also <A HREF="language.variables.smarty.html#language.variables.smarty.const" ><TT CLASS="parameter" ><I >$smarty.const</I ></TT ></A > and <A HREF="variable.php.handling.html" ><TT CLASS="parameter" ><I >$php_handling constants</I ></TT ></A > </P ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><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="constant.smarty.core.dir.html" ACCESSKEY="N" >Next</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >Smarty For Programmers</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" >SMARTY_CORE_DIR</TD ></TR ></TABLE ></DIV ></BODY ></HTML >