Files
smarty/docs/en/programmers/smarty-constants.xml
2006-09-27 07:20:56 +00:00

91 lines
2.5 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ -->
<chapter id="smarty.constants">
<title>Constants</title>
<sect1 id="constant.smarty.dir">
<title>SMARTY_DIR</title>
<para>
This is the <emphasis role="bold">full system path</emphasis>
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
<emphasis role="bold">must end with a trailing slash/</emphasis>.
</para>
<example>
<title>SMARTY_DIR</title>
<programlisting role="php">
<![CDATA[
<?php
// set path to Smarty directory *nix style
define('SMARTY_DIR', '/usr/local/lib/php/Smarty-v.e.r/libs/');
// path to Smarty windows style
define('SMARTY_DIR', 'c:/webroot/libs/Smarty-v.e.r/libs/');
// include the smarty class, note 'S' is upper case
require_once(SMARTY_DIR . 'Smarty.class.php');
?>
]]>
</programlisting>
</example>
<para>
See also
<link linkend="language.variables.smarty.const"><parameter>$smarty.const</parameter></link>
and
<link
linkend="variable.php.handling"><parameter>$php_handling constants</parameter></link>
</para>
</sect1>
<sect1 id="constant.smarty.core.dir">
<title>SMARTY_CORE_DIR</title>
<para>
This if the <emphasis>full system path</emphasis> to the location of the Smarty core
files. If not defined, Smarty will default this constant to the
<filename>internals/</filename> sub-directory below
<link linkend="constant.smarty.dir"><constant>SMARTY_DIR</constant></link>.
If defined, the path must end with a slash/.
Use this constant when manually including any of the core.* files.
</para>
<example>
<title>SMARTY_CORE_DIR</title>
<programlisting role="php">
<![CDATA[
<?php
// load core.get_microtime.php
require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
?>
]]>
</programlisting>
</example>
<para>
See also
<link linkend="language.variables.smarty.const"><parameter>$smarty.const</parameter></link>
</para>
</sect1>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->