mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-17 14:35:19 +02:00
more examples, WS and linking from Peter. Thanks :)
This commit is contained in:
@@ -17,7 +17,16 @@ $smarty->autoload_filters = array('pre' => array('trim', 'stamp'),
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</informalexample>
|
||||
</informalexample>
|
||||
</para>
|
||||
|
||||
<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>
|
||||
and
|
||||
<link linkend="api.load.filter">load_filter()</link>
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
|
@@ -4,11 +4,13 @@
|
||||
<title>$cache_dir</title>
|
||||
<para>
|
||||
This is the name of the directory where template caches are
|
||||
stored. By default this is "./cache", meaning that it will look
|
||||
for the cache directory in the same directory as the executing
|
||||
php script.
|
||||
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.
|
||||
<emphasis role="bold">This directory must
|
||||
be writeable by the web server. </emphasis>
|
||||
be writeable by the web server</emphasis>
|
||||
(<link linkend="installing.smarty.basic">see install</link>).
|
||||
You can also use your own
|
||||
<link linkend="section.template.cache.handler.func">
|
||||
custom cache handler</link>
|
||||
@@ -64,3 +66,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
@@ -3,7 +3,8 @@
|
||||
<sect1 id="variable.caching">
|
||||
<title>$caching</title>
|
||||
<para>
|
||||
This tells Smarty whether or not to cache the output of the templates.
|
||||
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
|
||||
|
@@ -4,10 +4,14 @@
|
||||
<title>$compile_dir</title>
|
||||
<para>
|
||||
This is the name of the directory where compiled templates are
|
||||
located. By default this is "./templates_c", meaning that it
|
||||
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
|
||||
the executing php script. <emphasis role="bold">This directory must
|
||||
be writeable by the web server. </emphasis> See also
|
||||
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>.
|
||||
|
||||
</para>
|
||||
|
@@ -6,9 +6,10 @@
|
||||
This is the directory used to store
|
||||
<link linkend="config.files">config files</link>
|
||||
used in the
|
||||
templates. Default is "./configs", meaning that it will look
|
||||
for the configs directory in the same directory as the
|
||||
executing php script.
|
||||
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.
|
||||
</para>
|
||||
<note>
|
||||
<title>Technical Note</title>
|
||||
|
@@ -4,7 +4,8 @@
|
||||
<title>$debug_tpl</title>
|
||||
<para>
|
||||
This is the name of the template file used for the debugging console. By
|
||||
default, it is named debug.tpl and is located in the <link
|
||||
default, it is named <filename>debug.tpl</filename> and is
|
||||
located in the <link
|
||||
linkend="constant.smarty.dir">SMARTY_DIR</link>.
|
||||
</para>
|
||||
<para>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
SMARTY_PHP_PASSTHRU. Note that this does NOT affect php code
|
||||
within <link linkend="language.function.php">{php}{/php}</link>
|
||||
tags in the template.
|
||||
</para>
|
||||
</para>
|
||||
<itemizedlist>
|
||||
<listitem><para>SMARTY_PHP_PASSTHRU - Smarty echos tags as-is.</para></listitem>
|
||||
<listitem><para>SMARTY_PHP_QUOTE - Smarty quotes the tags as
|
||||
@@ -21,8 +21,8 @@
|
||||
<note>
|
||||
<para>
|
||||
Embedding PHP code into templates is highly discouraged.
|
||||
Use <link linkend="language.custom.functions">custom functions</link> or
|
||||
<link linkend="language.modifiers">modifiers</link> instead.
|
||||
Use <link linkend="plugins.functions">custom functions</link> or
|
||||
<link linkend="plugins.modifiers">modifiers</link> instead.
|
||||
</para>
|
||||
</note>
|
||||
</sect1>
|
||||
|
@@ -4,7 +4,8 @@
|
||||
<title>$plugins_dir</title>
|
||||
<para>
|
||||
This is the directory (or directories) where Smarty will look for the
|
||||
plugins that it needs. Default is "plugins" under 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
|
||||
@@ -13,14 +14,33 @@
|
||||
search for your plugin in each plugin directory in the order they are
|
||||
given.
|
||||
</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.
|
||||
</para>
|
||||
</note>
|
||||
<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.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<example>
|
||||
<title>multiple $plugins_dir</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
$smarty->plugins_dir = array(
|
||||
'plugins', // the default under SMARTY_DIR
|
||||
'/path/to/shared/plugins',
|
||||
'../../includes/my/plugins'
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -5,9 +5,12 @@
|
||||
<para>
|
||||
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 "./templates", meaning that it
|
||||
will look for the templates directory in the same directory as
|
||||
the executing php script.
|
||||
found here. By default this is
|
||||
<filename class="directory">"./templates"</filename>,
|
||||
meaning that Smarty
|
||||
will look for the
|
||||
<filename class="directory">templates</filename> directory in
|
||||
the same directory as the executing php script.
|
||||
</para>
|
||||
<note>
|
||||
<title>Technical Note</title>
|
||||
|
@@ -23,8 +23,9 @@ nothing.
|
||||
<note>
|
||||
<title>Technical Note</title>
|
||||
<para>
|
||||
$use_sub_dirs=true doesn't work with safe_mode=On, that's why it's
|
||||
switchable and why it's off by default.
|
||||
$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>
|
||||
</note>
|
||||
<note>
|
||||
|
Reference in New Issue
Block a user