Tidy up of formatting

This commit is contained in:
pete_morgan
2006-09-27 06:28:21 +00:00
parent 9a5853dba9
commit a970418813
33 changed files with 374 additions and 285 deletions

View File

@@ -22,11 +22,11 @@ $smarty->autoload_filters = array('pre' => array('trim', 'stamp'),
<para>
See also
<link linkend="api.register.outputfilter">register_outputfilter()</link>,
<link linkend="api.register.prefilter">register_prefilter()</link>,
<link linkend="api.register.postfilter">register_postfilter()</link>
<link linkend="api.register.outputfilter"><varname>register_outputfilter()</varname></link>,
<link linkend="api.register.prefilter"><varname>register_prefilter()</varname></link>,
<link linkend="api.register.postfilter"><varname>register_postfilter()</varname></link>
and
<link linkend="api.load.filter">load_filter()</link>
<link linkend="api.load.filter"><varname>load_filter()</varname></link>
</para>
</sect1>

View File

@@ -5,19 +5,21 @@
<para>
This is the name of the directory where template caches are
stored. By default this is
<filename class="directory">"./cache"</filename>, meaning that
Smarty will look for the cache directory in the same directory
as the executing php script.
<filename class="directory">./cache</filename>, meaning that
Smarty will look for the <filename class="directory">cache/</filename> directory
in the same directory as the executing php script.
<emphasis role="bold">This directory must
be writeable by the web server</emphasis>
(<link linkend="installing.smarty.basic">see install</link>).
be writeable by the web server</emphasis>,
<link linkend="installing.smarty.basic">see install</link> for more info.
</para>
<para>
You can also use your own
<link linkend="section.template.cache.handler.func">
custom cache handler</link>
function to control cache files, which will ignore this
setting.
See also
<link linkend="variable.use.sub.dirs">$use_sub_dirs</link>.
<link linkend="variable.use.sub.dirs"><parameter>$use_sub_dirs</parameter></link>.
</para>
<note>
<title>Technical Note</title>
@@ -36,13 +38,13 @@
<para>
See also
<link linkend="variable.caching">$caching</link>,
<link linkend="variable.use.sub.dirs">$use_sub_dirs</link>,
<link linkend="variable.cache.lifetime">$cache_lifetime</link>,
<link linkend="variable.cache.handler.func">$cache_handler_func</link>,
<link linkend="variable.cache.modified.check">$cache_modified_check</link>
and
<link linkend="caching">Caching section</link>.
<link linkend="variable.caching"><parameter>$caching</parameter></link>,
<link linkend="variable.use.sub.dirs"><parameter>$use_sub_dirs</parameter></link>,
<link linkend="variable.cache.lifetime"><parameter>$cache_lifetime</parameter></link>,
<link linkend="variable.cache.handler.func"><parameter>$cache_handler_func</parameter></link>,
<link linkend="variable.cache.modified.check"><parameter>$cache_modified_check</parameter></link>
and the
<link linkend="caching">caching section</link>.
</para>
</sect1>

View File

@@ -5,9 +5,9 @@
<para>
You can supply a custom function to handle cache files instead
of using the built-in method using the
<link linkend="variable.cache.dir">$cache_dir</link>. See the
custom <link linkend="section.template.cache.handler.func">cache
handler function section</link> for details.
<link linkend="variable.cache.dir"><parameter>$cache_dir</parameter></link>.
See the custom <link linkend="section.template.cache.handler.func">cache
handler function section</link> for more details.
</para>
</sect1>

View File

@@ -4,31 +4,45 @@
<title>$cache_lifetime</title>
<para>
This is the length of time in seconds that a template cache is valid.
Once this time has expired, the cache will be regenerated. $caching must
be turned on (either 1 or 2) for $cache_lifetime to have any purpose. A
value of -1 will force the cache to never expire. A value of 0 will cause
Once this time has expired, the cache will be regenerated.
</para>
<itemizedlist>
<listitem><para>
<parameter>$caching</parameter> must be turned on (either 1 or 2) for
<parameter>$cache_lifetime</parameter> to have any purpose.
</para></listitem>
<listitem><para>
A value of -1 will force the cache to never expire.
</para></listitem>
<listitem><para>A value of 0 will cause
the cache to always regenerate (good for testing only, to disable caching
a more efficient method is to set <link
linkend="variable.caching">$caching</link> = 0.)
</para>
linkend="variable.caching"><parameter>$caching</parameter></link> = 0).
</para></listitem>
<listitem><para>
If you want to give certain templates their own cache lifetime, you could
do this by setting <link linkend="variable.caching">
<parameter>$caching</parameter></link> = 2,
then set <parameter>$cache_lifetime</parameter> to a unique value just
before calling <link linkend="api.display"><varname>display()</varname>
</link> or <link linkend="api.fetch"><varname>fetch()</varname></link>.
</para></listitem>
</itemizedlist>
<para>
If <link linkend="variable.force.compile">$force_compile</link> is
If <link linkend="variable.force.compile">
<parameter>$force_compile</parameter></link> is
enabled, the cache files will be regenerated every time, effectively
disabling caching. You can clear all the cache files with the <link
linkend="api.clear.all.cache">clear_all_cache()</link> function, or
individual cache files (or groups) with the <link
linkend="api.clear.cache">clear_cache()</link> function.
linkend="api.clear.all.cache"><varname>clear_all_cache()</varname></link>
function, or individual cache files (or groups) with the <link
linkend="api.clear.cache"><varname>clear_cache()</varname></link> function.
</para>
<note>
<title>Technical Note</title>
<para>
If you want to give certain templates their own cache lifetime, you could
do this by setting <link linkend="variable.caching">$caching</link> = 2,
then set $cache_lifetime to a unique value just before calling
<link linkend="api.display">display()</link>
or <link linkend="api.fetch">fetch()</link>.
</para>
</note>
</sect1>
<!-- Keep this comment at the end of the file

View File

@@ -3,22 +3,22 @@
<sect1 id="variable.cache.modified.check">
<title>$cache_modified_check</title>
<para>
If set to true, Smarty will respect the If-Modified-Since
If set to &true;, Smarty will respect the If-Modified-Since
header sent from the client. If the cached file timestamp has
not changed since the last visit, then a "304 Not Modified"
not changed since the last visit, then a <literal>'304: Not Modified'</literal>
header will be sent instead of the content. This works only on
cached content without
<link linkend="language.function.insert"><command>{insert}</command></link>
<link linkend="language.function.insert"><varname>{insert}</varname></link>
tags.
</para>
<para>
See also
<link linkend="variable.caching">$caching</link>,
<link linkend="variable.cache.lifetime">$cache_lifetime</link>,
<link linkend="variable.cache.handler.func">$cache_handler_func</link>,
and
<link linkend="caching">Caching section</link>.
<link linkend="variable.caching"><parameter>$caching</parameter></link>,
<link linkend="variable.cache.lifetime"><parameter>$cache_lifetime</parameter></link>,
<link linkend="variable.cache.handler.func"><parameter>$cache_handler_func</parameter></link>,
and the
<link linkend="caching">caching section</link>.
</para>
</sect1>

View File

@@ -4,43 +4,60 @@
<title>$caching</title>
<para>
This tells Smarty whether or not to cache the output of the templates
to the <link linkend="variable.cache.dir">$cache_dir</link>.
By default this is set to 0, or disabled. If your templates generate
redundant content, it is advisable to turn on $caching. This
will result in significant performance gains. You can also have
to the <link linkend="variable.cache.dir">
<parameter>$cache_dir</parameter></link>.
By default this is set to 0 ie disabled. If your templates generate
redundant content, it is advisable to turn on
<parameter>$caching</parameter>, as this will result in significant
performance gains.
</para>
<para>
You can also have
<link linkend="caching.multiple.caches">multiple</link>
caches for the same template. A value of 1 or 2 enables caching. 1 tells
Smarty to use the current
<link linkend="variable.cache.lifetime">$cache_lifetime</link>
variable to determine if the
cache has expired. A value of 2 tells Smarty to use the
<link linkend="variable.cache.lifetime">$cache_lifetime</link>
value at the time the cache was generated. This way you can set the
<link linkend="variable.cache.lifetime">$cache_lifetime</link>
just before
<link linkend="api.fetch">fetching</link>
the template to have granular
control over when that particular cache expires.
See also <link linkend="api.is.cached">is_cached()</link>.
</para>
<para>
If <link linkend="variable.compile.check">$compile_check</link>
caches for the same template.
</para>
<itemizedlist>
<listitem><para>
A value of 1 or 2 enables caching.
</para></listitem>
<listitem><para>
A value of 1 tells Smarty to use the current
<link linkend="variable.cache.lifetime"><parameter>$cache_lifetime</parameter></link>
variable to determine if the cache has expired.
</para></listitem>
<listitem><para>A value of 2 tells Smarty to use the
<link linkend="variable.cache.lifetime"><parameter>$cache_lifetime</parameter></link>
value at the time the cache was generated. This way you can set the
<link linkend="variable.cache.lifetime"> <parameter>$cache_lifetime</parameter></link>
just before <link linkend="api.fetch">fetching</link>
the template to have granular control over when that particular cache expires.
See also <link linkend="api.is.cached"><varname>is_cached()</varname></link>.
</para></listitem>
<listitem><para>
If <link linkend="variable.compile.check"><parameter>$compile_check</parameter></link>
is enabled, the cached content will be regenerated if
any of the templates or config files that are part of this cache are
changed. If
<link linkend="variable.force.compile">$force_compile</link>
is enabled, the cached content will always be
regenerated.
</para>
changed.
</para></listitem>
<listitem><para>
If <link linkend="variable.force.compile">
<parameter>$force_compile</parameter></link> is enabled, the cached
content will always be regenerated.
</para></listitem>
</itemizedlist>
<para>
See also
<link linkend="variable.cache.dir">$cache_dir</link>,
<link linkend="variable.cache.lifetime">$cache_lifetime</link>,
<link linkend="variable.cache.handler.func">$cache_handler_func</link>,
<link linkend="variable.cache.modified.check">$cache_modified_check</link>
and
<link linkend="caching">Caching section</link>.
<link linkend="variable.cache.dir"><parameter>$cache_dir</parameter></link>,
<link linkend="variable.cache.lifetime"><parameter>$cache_lifetime</parameter></link>,
<link linkend="variable.cache.handler.func"><parameter>$cache_handler_func</parameter></link>,
<link linkend="variable.cache.modified.check"><parameter>$cache_modified_check</parameter></link>,
<link linkend="api.is.cached"><varname>is_cached()</varname></link>
and the
<link linkend="caching">caching section</link>.
</para>
</sect1>
@@ -63,4 +80,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
-->

View File

@@ -7,20 +7,23 @@
current template has changed (different time stamp) since the last time
it was compiled. If it has changed, it recompiles that template. If the
template has not been compiled, it will compile regardless of this
setting. By default this variable is set to true.
setting. By default this variable is set to &true;.
</para>
<para>Once an application is
put into production (templates won't be changing), the compile_check
step is no longer needed. Be sure to set $compile_check to "false" for
maximal performance. Note that if you change this to "false" and a
put into production (ie the templates won't be changing),
the compile check step is no longer needed. Be sure to set
<parameter>$compile_check</parameter> to &false; for
maximal performance. Note that if you change this to &false; and a
template file is changed, you will *not* see the change since the
template will not get recompiled. If
<link linkend="variable.caching">$caching</link>
is enabled and
$compile_check is enabled, then the cache files will get regenerated if
<link linkend="variable.caching"><parameter>$caching</parameter></link>
is enabled and <parameter>$compile_check</parameter> is enabled, then
the cache files will get regenerated if
an involved template file or config file was updated. See <link
linkend="variable.force.compile">$force_compile</link> or <link
linkend="api.clear.compiled.tpl">clear_compiled_tpl()</link>.
linkend="variable.force.compile">
<parameter>$force_compile</parameter></link> and <link
linkend="api.clear.compiled.tpl"><varname>clear_compiled_tpl()</varname>
</link>.
</para>
</sect1>
<!-- Keep this comment at the end of the file
@@ -42,4 +45,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
-->

View File

@@ -5,16 +5,14 @@
<para>
This is the name of the directory where compiled templates are
located. By default this is
<filename class="directory">"./templates_c"</filename>
, meaning that it
will look for the compile directory in the same directory as
<filename class="directory">./templates_c</filename>, meaning that Smarty
will look for the <filename class="directory">templates_c/</filename>
directory in the same directory as
the executing php script. <emphasis role="bold">This directory must
be writeable by the web server</emphasis>
(<link linkend="installing.smarty.basic">see install</link>).
Also
<link linkend="variable.use.sub.dirs">$use_sub_dirs</link>.
be writeable by the web server</emphasis>,
<link linkend="installing.smarty.basic">see install</link> for more info.
</para>
<note>
<title>Technical Note</title>
<para>
@@ -30,9 +28,9 @@
</para>
</note>
<para>
See also <link linkend="variable.compile.id">$compile_id</link>
See also <link linkend="variable.compile.id"><parameter>$compile_id</parameter></link>
and
<link linkend="variable.use.sub.dirs">$use_sub_dirs</link>.
<link linkend="variable.use.sub.dirs"><parameter>$use_sub_dirs</parameter></link>.
</para>
</sect1>
<!-- Keep this comment at the end of the file
@@ -54,4 +52,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
-->

View File

@@ -4,29 +4,30 @@
<title>$compile_id</title>
<para>
Persistant compile identifier. As an alternative to passing the same
$compile_id to each and every function call, you can set this
$compile_id and it will be used implicitly thereafter.
<parameter>$compile_id</parameter> to each and every function call, you can set this
<parameter>$compile_id</parameter> and it will be used implicitly thereafter.
</para>
<para>
With a $compile_id you can work around the limitation that you cannot
use the same
<link linkend="variable.compile.dir">$compile_dir</link>
for different
<link linkend="variable.template.dir">$template_dirs</link>. If you set a
distinct $compile_id for each
<link linkend="variable.template.dir">$template_dir</link> then Smarty can tell the
compiled templates apart by their $compile_id.
With a <parameter>$compile_id</parameter> you can work around the limitation
that you cannot use the same
<link linkend="variable.compile.dir"><parameter>$compile_dir</parameter></link>
for different <link linkend="variable.template.dir">
<parameter>$template_dirs</parameter></link>. If you set a distinct
<parameter>$compile_id</parameter> for each
<link linkend="variable.template.dir"><parameter>$template_dir</parameter>
</link> then Smarty can tell the compiled templates apart by their
<parameter>$compile_id</parameter>.
</para>
<para>
If you have for example a
<link linkend="plugins.prefilters.postfilters">prefilter</link>
that localizes your templates
(that is: translates language dependend parts) at compile time, then
you should use the current language as $compile_id and you will get a
set of compiled templates for each language you use.
you could use the current language as <parameter>$compile_id</parameter> and
you will get a set of compiled templates for each language you use.
</para>
<para>
Another example would be to use the same compile directory across
Another application would be to use the same compile directory across
multiple domains / multiple virtual hosts.
</para>
<example>

View File

@@ -3,10 +3,15 @@
<sect1 id="variable.config.booleanize">
<title>$config_booleanize</title>
<para>
If set to true, config file values of on/true/yes and off/false/no get
If set to &true;, <link linkend="config.files">config files</link>
values of <literal>on/true/yes</literal>
and <literal>off/false/no</literal> get
converted to boolean values automatically. This way you can use the
values in the template like so: {if #foobar#} ... {/if}. If foobar was
on, true or yes, the {if} statement will execute. true by default.
values in the template like so:
<literal>{if #foobar#}...{/if}</literal>. If foobar was
<literal>on</literal>, <literal>true</literal> or <literal>yes</literal>,
the <varname>{if}</varname> statement will execute.
Defaults to &true;.
</para>
</sect1>
<!-- Keep this comment at the end of the file

View File

@@ -7,9 +7,9 @@
<link linkend="config.files">config files</link>
used in the
templates. Default is
<filename class="directory">"./configs"</filename>, meaning that
Smarty will look for the configs directory in the same directory
as the executing php script.
<filename class="directory">./configs</filename>, meaning that
Smarty will look for the <filename class="directory">configs/</filename>
directory in the same directory as the executing php script.
</para>
<note>
<title>Technical Note</title>
@@ -38,4 +38,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
-->

View File

@@ -3,8 +3,10 @@
<sect1 id="variable.config.fix.newlines">
<title>$config_fix_newlines</title>
<para>
If set to true, mac and dos newlines (\r and \r\n) in config files are
converted to \n when they are parsed. true by default.
If set to &true;, mac and dos newlines ie <literal>'\r'</literal> and
<literal>'\r\n'</literal> in config files are
converted to <literal>'\n'</literal> when they are parsed.
Default is &true;.
</para>
</sect1>
<!-- Keep this comment at the end of the file

View File

@@ -3,7 +3,7 @@
<sect1 id="variable.config.overwrite">
<title>$config_overwrite</title>
<para>
If set to true (by default), variables read in from
If set to &true;, the default then variables read in from
<link linkend="config.files">config files</link> will overwrite each
other. Otherwise, the variables will be pushed onto an array. This is
helpful if you want to store arrays of data in config files, just list
@@ -11,12 +11,12 @@
</para>
<example>
<title>Array of config variables</title>
<title>Array of config #variables#</title>
<para>
This examples uses
<link linkend="language.function.cycle">{cycle}</link> to
output a table with alternating red/green/blue row colors
with $config_overwrite = false.
<link linkend="language.function.cycle"><varname>{cycle}</varname></link>
to output a table with alternating red/green/blue row colors
with <parameter>$config_overwrite</parameter> = &false;.
</para>
<para>The config file.</para>
<programlisting>
@@ -28,8 +28,8 @@ rowColors = #0000FF
]]>
</programlisting>
<para>
The template with a
<link linkend="language.function.section">{section}</link> loop.
The template with a <link linkend="language.function.section">
<varname>{section}</varname></link> loop.
</para>
<programlisting>
<![CDATA[
@@ -45,12 +45,11 @@ rowColors = #0000FF
</example>
<para>
See also
<link linkend="language.function.config.load">{config_load}</link>,
<link linkend="config.files">config files</link>,
<link linkend="api.get.config.vars">get_config_vars()</link>,
<link linkend="api.clear.config">clear_config()</link>
and
<link linkend="api.config.load">config_load()</link>.
<link linkend="language.function.config.load"><varname>{config_load}</varname></link>,
<link linkend="api.get.config.vars"><varname>get_config_vars()</varname></link>,
<link linkend="api.clear.config"><varname>clear_config()</varname></link>,
<link linkend="api.config.load"><varname>config_load()</varname></link>
and the <link linkend="config.files">config files section</link>.
</para>
</sect1>

View File

@@ -3,13 +3,12 @@
<sect1 id="variable.config.read.hidden">
<title>$config_read_hidden</title>
<para>
If set to true, hidden sections (section names beginning with a period)
in
<link linkend="config.files">config files</link>
If set to &true;, hidden sections ie section names beginning with a .period
in <link linkend="config.files">config files</link>
can be read from templates. Typically you would leave
this false, that way you can store sensitive data in the config files
this &false;, that way you can store sensitive data in the config files
such as database parameters and not worry about the template loading
them. false by default.
them. &false; by default.
</para>
</sect1>
<!-- Keep this comment at the end of the file

View File

@@ -6,13 +6,13 @@
This is the name of the template file used for the debugging console. By
default, it is named <filename>debug.tpl</filename> and is
located in the <link
linkend="constant.smarty.dir">SMARTY_DIR</link>.
linkend="constant.smarty.dir"><constant>SMARTY_DIR</constant></link>.
</para>
<para>
See also
<link linkend="variable.debugging">$debugging</link>
and
<link linkend="chapter.debugging.console">Debugging console</link>
<link linkend="variable.debugging"><parameter>$debugging</parameter></link>
and the
<link linkend="chapter.debugging.console">debugging console</link> section.
</para>
</sect1>
<!-- Keep this comment at the end of the file

View File

@@ -3,15 +3,32 @@
<sect1 id="variable.debugging.ctrl">
<title>$debugging_ctrl</title>
<para>
This allows alternate ways to enable debugging. NONE means no
alternate methods are allowed. URL means when the keyword
SMARTY_DEBUG is found in the QUERY_STRING, debugging is enabled
for that invocation of the script. If
<link linkend="variable.debugging">$debugging</link> is true, this
value is ignored.
This allows alternate ways to enable debugging. <literal>NONE</literal>
means no alternate methods are allowed. <literal>URL</literal>
means when the keyword <literal>SMARTY_DEBUG</literal> is found in the
<literal>QUERY_STRING</literal>, debugging is enabled for that
invocation of the script. If <link linkend="variable.debugging">
<parameter>$debugging</parameter></link> is &true;, this value is ignored.
</para>
<example>
<title>$debugging_ctrl on localhost</title>
<programlisting role="php">
<![CDATA[
<?php
// shows debug console only on localhost ie
// http://localhost/script.php?foo=bar&SMARTY_DEBUG
$smarty->debugging = false; // the default
$smarty->debugging_ctrl = ($_SERVER['SERVER_NAME'] == 'localhost') ? 'URL' : 'NONE';
?>
]]>
</programlisting>
</example>
<para>
See also <link linkend="chapter.debugging.console">Debugging console</link>.
See also <link linkend="chapter.debugging.console">debugging console</link>
section and
<link linkend="variable.debugging"><parameter>$debugging</parameter></link>.
</para>
</sect1>
<!-- Keep this comment at the end of the file
@@ -33,4 +50,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
-->

View File

@@ -10,18 +10,20 @@
templates, variables <link linkend="api.assign">assigned</link>
from php and
<link linkend="language.config.variables">config file variables</link>
for the current template page. It does not show variables
assigned within a template with
<link linkend="language.function.assign">{assign}</link>.
for the current script. It does not show variables
assigned within a template with the
<link linkend="language.function.assign"><varname>{assign}</varname>
</link> function.
</para>
<para>Also see <link linkend="variable.debugging.ctrl">$debugging_ctrl</link>
on how to enable debugging from the url.
<para>The console can also be enabled from the url with
<link linkend="variable.debugging.ctrl">
<parameter>$debugging_ctrl</parameter></link>.
</para>
<para>
See also
<link linkend="language.function.debug">{debug}</link>,
<link linkend="variable.debug.tpl">$debug_tpl</link>,
and <link linkend="variable.debugging.ctrl">$debugging_ctrl</link>
<link linkend="language.function.debug"><varname>{debug}</varname></link>,
<link linkend="variable.debug.tpl"><parameter>$debug_tpl</parameter></link>,
and <link linkend="variable.debugging.ctrl"><parameter>$debugging_ctrl</parameter></link>.
</para>
</sect1>
<!-- Keep this comment at the end of the file
@@ -43,4 +45,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
-->

View File

@@ -5,10 +5,12 @@
<para>
This is an array of modifiers to implicitly apply to every variable in a
template. For example, to HTML-escape every variable by default, use
array('escape:"htmlall"'); To make a variable exempt from default
modifiers, pass the special "smarty" modifier with a parameter value of
"nodefaults" modifier to it, such as
{$var|smarty:nodefaults}.
<literal>array('escape:"htmlall"')</literal>.
To make a variable exempt from default
modifiers, pass the special <literal>smarty</literal> modifier with a
parameter value of
<literal>nodefaults</literal> modifier to it, such as
<literal>{$var|smarty:nodefaults}</literal>.
</para>
</sect1>
<!-- Keep this comment at the end of the file

View File

@@ -4,9 +4,11 @@
<title>$default_resource_type</title>
<para>
This tells smarty what resource type to use implicitly. The default value
is 'file', meaning that $smarty->display('index.tpl'); and
$smarty->display('file:index.tpl'); are identical in meaning. See the
<link linkend="template.resources">resource</link> chapter for details.
is <literal>file</literal>, meaning that
<literal>$smarty->display('index.tpl')</literal> and
<literal>$smarty->display('file:index.tpl')</literal> are identical in
meaning. See the <link linkend="template.resources">resource</link>
chapter for more details.
</para>
</sect1>
<!-- Keep this comment at the end of the file

View File

@@ -4,18 +4,18 @@
<title>$error_reporting</title>
<para>
When this value is set to a non-null-value it's value is used as php's
<ulink url="&url.php-manual;error_reporting">error_reporting</ulink>
level inside of <link linkend="api.display">display()</link>
and <link linkend="api.fetch">fetch()</link>. When <link
linkend="chapter.debugging.console">debugging</link> is enabled this value
is ignored and the error-level is left untouched.
<ulink url="&url.php-manual;error_reporting"><varname>error_reporting</varname></ulink>
level inside of <link linkend="api.display"><varname>display()</varname></link>
and <link linkend="api.fetch"><varname>fetch()</varname></link>. When <link
linkend="chapter.debugging.console"><parameter>debugging</parameter></link>
is enabled this value is ignored and the error-level is left untouched.
</para>
<para>
See also
<link linkend="api.trigger.error">trigger_error()</link>,
<link linkend="api.trigger.error"><varname>trigger_error()</varname></link>,
<link linkend="chapter.debugging.console">debugging</link>
and
<link linkend="troubleshooting">Troubleshooting</link>.
<link linkend="troubleshooting">troubleshooting</link>.
</para>
</sect1>

View File

@@ -5,12 +5,13 @@
<para>
This forces Smarty to (re)compile templates on every
invocation. This setting overrides
<link linkend="variable.compile.check">$compile_check</link>.
<link linkend="variable.compile.check">
<parameter>$compile_check</parameter></link>.
By default
this is disabled. This is handy for development and
this is &false;. This is handy for development and
<link linkend="chapter.debugging.console">debugging</link>.
It should never be used in a production environment. If
<link linkend="variable.caching">$caching</link>
<link linkend="variable.caching"><parameter>$caching</parameter></link>
is enabled, the cache file(s) will be regenerated every time.
</para>
</sect1>

View File

@@ -4,10 +4,10 @@
<title>$left_delimiter</title>
<para>
This is the left delimiter used by the template language.
Default is "{".
Default is <literal>{</literal>.
</para>
<para>
See also <link linkend="variable.right.delimiter">$right_delimiter</link>
See also <link linkend="variable.right.delimiter"><parameter>$right_delimiter</parameter></link>
and
<link linkend="language.escaping">escaping smarty parsing</link>
.

View File

@@ -4,21 +4,33 @@
<title>$php_handling</title>
<para>
This tells Smarty how to handle PHP code embedded in the
templates. There are four possible settings, default being
SMARTY_PHP_PASSTHRU. Note that this does NOT affect php code
within <link linkend="language.function.php">{php}{/php}</link>
tags in the template.
templates. There are four possible settings, the default being
<constant>SMARTY_PHP_PASSTHRU</constant>. Note that this does NOT affect
php code within <link linkend="language.function.php">
<varname>{php}{/php}</varname></link> tags in the template.
</para>
<itemizedlist>
<listitem><para>SMARTY_PHP_PASSTHRU - Smarty echos tags as-is.</para></listitem>
<listitem><para>SMARTY_PHP_QUOTE - Smarty quotes the tags as
html entities.</para></listitem>
<listitem><para>SMARTY_PHP_REMOVE - Smarty removes the tags from
<listitem><para>
<constant>SMARTY_PHP_PASSTHRU</constant> - Smarty echos tags as-is.
</para></listitem>
<listitem><para>
<constant>SMARTY_PHP_QUOTE</constant> - Smarty quotes the tags as
html entities.
</para></listitem>
<listitem><para>
<constant>SMARTY_PHP_REMOVE</constant> - Smarty removes the tags from
the templates.</para></listitem>
<listitem><para>SMARTY_PHP_ALLOW - Smarty will execute the tags
<listitem><para>
<constant>SMARTY_PHP_ALLOW</constant> - Smarty will execute the tags
as PHP code.</para></listitem>
</itemizedlist>
<note>
<note>
<para>
Embedding PHP code into templates is highly discouraged.
Use <link linkend="plugins.functions">custom functions</link> or

View File

@@ -3,23 +3,25 @@
<sect1 id="variable.plugins.dir">
<title>$plugins_dir</title>
<para>
This is the directory (or directories) where Smarty will look for the
This is the directory or directories where Smarty will look for the
plugins that it needs. Default is
<filename class="directory">"plugins"</filename> under the
<link linkend="constant.smarty.dir">SMARTY_DIR</link>. If you
supply a relative path, Smarty will first look under the
<link linkend="constant.smarty.dir">SMARTY_DIR</link>, then
relative to the cwd (current working directory), then relative to the PHP
include_path. If $plugins_dir is an array of directories, Smarty will
search for your plugin in each plugin directory in the order they are
given.
<filename class="directory">plugins/</filename> under the
<link linkend="constant.smarty.dir"><constant>SMARTY_DIR</constant></link>.
If you supply a relative path, Smarty will first look under the
<link linkend="constant.smarty.dir"><constant>SMARTY_DIR</constant></link>, then
relative to the current working directory, then relative to the PHP
include_path. If <parameter>$plugins_dir</parameter>
is an array of directories, Smarty will
search for your plugin in each plugin directory
<emphasis role="bold">in the order they are given</emphasis>.
</para>
<note>
<title>Technical Note</title>
<para>
For best performance, do not setup your $plugins_dir to have to use
the PHP include path. Use an absolute pathname, or a path relative
to SMARTY_DIR or the cwd.
For best performance, do not setup your <parameter>$plugins_dir</parameter>
to have to use the PHP include path. Use an absolute pathname,
or a path relative to <constant>SMARTY_DIR</constant> or the current
working directory.
</para>
</note>
@@ -36,9 +38,8 @@ $smarty->plugins_dir[] = 'includes/my_smarty_plugins';
]]>
</programlisting>
</example>
<example>
<title>multiple $plugins_dir</title>
<title>Multiple $plugins_dir</title>
<programlisting role="php">
<![CDATA[
<?php

View File

@@ -2,16 +2,23 @@
<!-- $Revision$ -->
<sect1 id="variable.request.use.auto.globals">
<title>$request_use_auto_globals</title>
<para>
Specifies if Smarty should use php's $HTTP_*_VARS[]
($request_use_auto_globals=false) or $_*[] ($request_use_auto_globals=true
which is the default value). This affects templates that make use of
<link linkend="language.variables.smarty">{$smarty.request.*}, {$smarty.get.*}</link> etc. .
Caution: If you set $request_use_auto_globals to true, <link
linkend="variable.request.vars.order">$request_vars_order
</link> has no effect but php's configuration value
<literal>gpc_order</literal> is used.
<para>
Specifies if Smarty should use PHP's <literal>$HTTP_*_VARS[]</literal>
when &false; or <literal>$_*[]</literal> when
&true; which is the default value. This affects templates that make use of
<link linkend="language.variables.smarty">
<literal>{$smarty.request.*}, {$smarty.get.*}</literal></link> etc.
</para>
<note>
<title>Caution</title>
<para>
If you set <literal>$request_use_auto_globals to true</literal>,
<link linkend="variable.request.vars.order">
<parameter>$request_vars_order</parameter></link> has no effect but
PHP's configuration value <literal>gpc_order</literal> is used.
</para>
</note>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:

View File

@@ -7,9 +7,10 @@
variables_order in php.ini
</para>
<para>
See also <link linkend="language.variables.smarty">$smarty.request</link>
See also
<link linkend="language.variables.smarty"><parameter>$smarty.request</parameter></link>
and
<link linkend="variable.request.use.auto.globals">$request_use_auto_globals</link>.
<link linkend="variable.request.use.auto.globals"><parameter>$request_use_auto_globals</parameter></link>.
</para>
</sect1>
<!-- Keep this comment at the end of the file

View File

@@ -4,10 +4,10 @@
<title>$right_delimiter</title>
<para>
This is the right delimiter used by the template language.
Default is "}".
Default is <literal>}</literal>.
</para>
<para>
See also <link linkend="variable.left.delimiter">$left_delimiter</link>
See also <link linkend="variable.left.delimiter"><parameter>$left_delimiter</parameter></link>
and
<link linkend="language.escaping">escaping smarty parsing</link>.
</para>

View File

@@ -5,13 +5,13 @@
<para>
This is an array of all local files and directories that are considered
secure.
<link linkend="language.function.include">{include}</link>
and <link linkend="language.function.fetch">{fetch}</link>
<link linkend="language.function.include"><varname>{include}</varname></link>
and <link linkend="language.function.fetch"><varname>{fetch}</varname></link>
use this when
<link linkend="variable.security">$security</link> is enabled.
<link linkend="variable.security"><parameter>$security</parameter></link> is enabled.
</para>
<example>
<title>$secure_dir example</title>
<programlisting role="php">
@@ -24,11 +24,11 @@ $smarty->secure_dir = $secure_dirs;
]]>
</programlisting>
</example>
<para>
See also
<link linkend="variable.security.settings">Security settings</link>,
and <link linkend="variable.trusted.dir">$trusted_dir</link>.
<link linkend="variable.security.settings"><parameter>$security_settings</parameter></link>
and <link linkend="variable.trusted.dir"><parameter>$trusted_dir</parameter></link>.
</para>
</sect1>

View File

@@ -4,49 +4,49 @@
<title>$security_settings</title>
<para>
These are used to override or specify the security settings when
<link linkend="variable.security">$security</link> is enabled.
<link linkend="variable.security"><parameter>$security</parameter></link> is enabled.
These are the possible settings:
</para>
<itemizedlist>
<listitem>
<para>
PHP_HANDLING - true/false. If set to true, the
<link linkend="variable.php.handling">$php_handling</link>
<constant>PHP_HANDLING</constant> - boolean. If set to &true;, the
<link linkend="variable.php.handling"><parameter>$php_handling</parameter></link>
setting is not checked for security.
</para>
</listitem>
<listitem>
<para>
IF_FUNCS - This is an array of the names of permitted PHP functions in
<link linkend="language.function.if">{if}</link> statements.
<constant>IF_FUNCS</constant> - array. The names of permitted PHP functions in
<link linkend="language.function.if"><varname>{if}</varname></link> statements.
</para>
</listitem>
<listitem>
<para>
INCLUDE_ANY - true/false. If set to true, any
template can be included from the file system, regardless of the
<link linkend="variable.secure.dir">$secure_dir</link> list.
<constant>INCLUDE_ANY</constant> - boolean. If set to &true;, any
template can be <link linkend="language.function.include">included</link>
from the file system, regardless of the
<link linkend="variable.secure.dir"><parameter>$secure_dir</parameter></link> list.
</para>
</listitem>
<listitem>
<para>
PHP_TAGS - true/false. If set to true,
<link linkend="language.function.php">{php}{/php}</link>
<constant>PHP_TAGS</constant> - boolean. If set to &true;,
<link linkend="language.function.php"><varname>{php}{/php}</varname></link>
tags are permitted in the templates.
</para>
</listitem>
<listitem>
<para>
MODIFIER_FUNCS - This is an array of the names of permitted
PHP functions used as variable modifiers.
<constant>MODIFIER_FUNCS</constant> - array. The names of permitted
PHP functions that can be used as variable modifiers.
</para>
</listitem>
<listitem>
<para>
ALLOW_CONSTANTS - true/false. If set to true, constants via
<link linkend="language.variables.smarty.const">{$smarty.const.name}</link>
are allowed in the templates. The defaults is set to
"false" for security.
<constant>ALLOW_CONSTANTS</constant> - boolean. If set to &true;, constants via
<link linkend="language.variables.smarty.const"><parameter>{$smarty.const.FOO}</parameter></link>
are allowed in the templates.
</para>
</listitem>
</itemizedlist>

View File

@@ -3,43 +3,44 @@
<sect1 id="variable.security">
<title>$security</title>
<para>
$security true/false, default is false. Security is good for
<parameter>$security</parameter> can be &true; or &false;,
defaults to &false;. Security is good for
situations when you have untrusted parties editing the templates
(via ftp for example) and you want to reduce the risk of system
eg via ftp, and you want to reduce the risk of system
security compromises through the template language. Turning on
security enforces the following rules to the template language,
unless specifially overridden with
<link linkend="variable.security.settings">$security_settings</link>:
unless specifially overridden with <link linkend="variable.security.settings">
<parameter>$security_settings</parameter></link>:
</para>
<itemizedlist>
<listitem>
<para>If <link linkend="variable.php.handling">$php_handling</link>
is set to SMARTY_PHP_ALLOW, this is
implicitly changed to SMARTY_PHP_PASSTHRU
<para>If <link linkend="variable.php.handling"><parameter>$php_handling</parameter></link>
is set to <constant>SMARTY_PHP_ALLOW</constant>, this is
implicitly changed to <constant>SMARTY_PHP_PASSTHRU</constant>
</para></listitem>
<listitem>
<para>
PHP functions are not allowed in <link
linkend="language.function.if">{if}</link> statements,
linkend="language.function.if"><varname>{if}</varname></link> statements,
except those specified in the
<link linkend="variable.security.settings">$security_settings</link>
<link linkend="variable.security.settings"><parameter>$security_settings</parameter></link>
</para></listitem>
<listitem><para>
templates can only be included from directories
Templates can only be included from directories
listed in the
<link linkend="variable.secure.dir">$secure_dir</link> array
<link linkend="variable.secure.dir"><parameter>$secure_dir</parameter></link> array
</para></listitem>
<listitem><para>
local files can only be fetched from directories listed in the
<link linkend="variable.secure.dir">$secure_dir</link>
array using <link linkend="language.function.fetch">{fetch}</link>
Local files can only be fetched from directories listed in the
<link linkend="variable.secure.dir"><parameter>$secure_dir</parameter></link>
array using <link linkend="language.function.fetch"><varname>{fetch}</varname></link>
</para></listitem>
<listitem><para>
<link linkend="language.function.php">{php}{/php}</link> tags are not allowed
<link linkend="language.function.php"><varname>{php}{/php}</varname></link> tags are not allowed
</para></listitem>
<listitem><para>
PHP functions are not allowed as modifiers, except those specified in the
<link linkend="variable.security.settings">$security_settings</link>
<link linkend="variable.security.settings"><parameter>$security_settings</parameter></link>
</para></listitem>
</itemizedlist>
</sect1>

View File

@@ -6,10 +6,10 @@
This is the name of the default template directory. If you do
not supply a resource type when including files, they will be
found here. By default this is
<filename class="directory">"./templates"</filename>,
<filename class="directory">./templates</filename>,
meaning that Smarty
will look for the
<filename class="directory">templates</filename> directory in
<filename class="directory">templates/</filename> directory in
the same directory as the executing php script.
</para>
<note>
@@ -39,4 +39,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
-->

View File

@@ -3,12 +3,12 @@
<sect1 id="variable.trusted.dir">
<title>$trusted_dir</title>
<para>
$trusted_dir is only for use when
<link linkend="variable.security">$security</link> is enabled.
<parameter>$trusted_dir</parameter> is only for use when
<link linkend="variable.security"><parameter>$security</parameter></link> is enabled.
This is an array of all directories that are considered trusted.
Trusted directories are where you keep php scripts that are executed
directly from the templates
with <link linkend="language.function.include.php">{include_php}</link>.
with <link linkend="language.function.include.php"><varname>{include_php}</varname></link>.
</para>
</sect1>
<!-- Keep this comment at the end of the file

View File

@@ -4,45 +4,48 @@
<title>$use_sub_dirs</title>
<para>
Smarty will create subdirectories under the
<link linkend="variable.compile.dir">templates_c</link> and
<link linkend="variable.compile.dir">compiled templates</link> and
<link linkend="variable.cache.dir">cache</link>
directories if $use_sub_dirs is set to true (default is false).
directories if <parameter>$use_sub_dirs</parameter> is set to &true;,
default is &false;.
In an environment where there are potentially tens of thousands of files created,
this may help the filesystem speed.
On the other hand, some environments do not allow PHP processes to
create directories, so this must be disabled. The default is false (disabled).
Sub directories are more efficient, so use them if you can.
create directories, so this must be disabled which is the default.
</para>
<para>
Sub directories are more efficient, so use them if you can.
Theoretically you get much better perfomance on a filesystem with 10
directories each having 100 files, than with 1 directory having 1000
files. This was certainly the case with Solaris 7 (UFS)... with newer
filesystems such as ext3 and especially reiserfs, the difference is almost
nothing.
</para>
<note>
<title>Technical Note</title>
<para>
$use_sub_dirs=true doesn't work with
<ulink url="&url.php-manual;features.safe-mode">safe_mode=On</ulink>,
that's why it's switchable and why it's off by default.
</para>
<para>
$use_sub_dirs=true on Windows can cause problems.
</para>
<itemizedlist>
<listitem>
<para><literal>$use_sub_dirs=true</literal> doesn't work with
<ulink url="&url.php-manual;features.safe-mode">safe_mode=On</ulink>,
that's why it's switchable and why it's off by default.
</para>
</listitem>
<listitem>
<para><literal>$use_sub_dirs=true</literal> on Windows can cause problems.</para>
</listitem>
<listitem>
<para>Safe_mode is being deprecated in PHP6.</para>
</listitem>
</itemizedlist>
</note>
<note>
<title>Note</title>
<para>
Since Smarty-2.6.2 <varname>$use_sub_dirs</varname> defaults to false.
</para>
</note>
<para>
See also
<link linkend="variable.compile.dir">$compile_dir</link>,
<link linkend="variable.compile.id">$compile_id</link>
<link linkend="variable.compile.id"><parameter>$compile_id</parameter></link>,
<link linkend="variable.cache.dir"><parameter>$cache_dir</parameter></link>,
and
<link linkend="variable.cache.dir">$cache_dir</link>.
<link linkend="variable.compile.dir"><parameter>$compile_dir</parameter></link>.
</para>
</sect1>
<!-- Keep this comment at the end of the file