added docs for php-functions as modifiers

This commit is contained in:
messju
2003-08-07 13:59:51 +00:00
parent a0b874850a
commit 7e68939702
2 changed files with 25 additions and 5 deletions

View File

@@ -490,6 +490,27 @@ Topic: {$topic|truncate:40:"..."}
<literal>{$articleTitle|@count}</literal> (this will print out the number of
elements in the $articleTitle array.)
</para>
<para>
Modifiers can be autoloaded from your <link
linkend="variable.plugins.dir">$plugins_dir</link> (also see:
<link linkend="plugins.naming.conventions">Naming
Conventions</link>) or can be registered explicitely (see: <link
linkend="api.register.modifier">register_modifier</link>). Additionally
all php-functions can be used as modifiers implicitely. (The
<literal>@count</literal>-example above actually uses php's
count-function and not a smarty-modifier). Using php-functions
as modifiers has two little pitfalls: First: Sometimes the order
of the function-parameters is not the desirable one
(<literal>{"%2.f"|sprintf:$float}</literal> actually works, but
asks for the more intuitive <literal>{For example:
$float|string_format:"%2.f"}</literal> that is provided by the
Smarty distribution). Second: with <link
linkend="variable.security">$security</link> turned on all
php-functions that are to be used as modifiers have to be
declared trusted in the <link
linkend="variable.security.settings">
$security_settings['MODIFIER_FUNCS']</link>-array.
</para>
<sect1 id="language.modifier.capitalize">
<title>capitalize</title>

View File

@@ -457,7 +457,6 @@ $smarty-&gt;autoload_filters = array('pre' =&gt; array('trim', 'stamp'),
</sect1>
<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 which is the default value) or
@@ -467,7 +466,6 @@ $smarty-&gt;autoload_filters = array('pre' =&gt; array('trim', 'stamp'),
linkend="variable.request.vars.order">variable.request.vars.order
</link> has no effect but php's configuration value
<literal>gpc_order</literal> is used.
</para>
</sect1>
<sect1 id="variable.compile.id">
@@ -2495,9 +2493,10 @@ $smarty->default_template_handler_func = 'make_template';
depends on the order in which they are registered or loaded.
</para>
<para>
There is only one plugins directory (for performance reasons). To
install a plugin, simply place it in the directory and Smarty will use
it automatically.
The <link linkend="variable.plugins.dir">plugins directory</link>
can be a string containing a path or an array containing multiple
paths. To install a plugin, simply place it in one of the
directories and Smarty will use it automatically.
</para>
</sect1>