From 7e68939702d40903d84f37e706fc4c1950930b58 Mon Sep 17 00:00:00 2001 From: messju Date: Thu, 7 Aug 2003 13:59:51 +0000 Subject: [PATCH] added docs for php-functions as modifiers --- docs/designers.sgml | 21 +++++++++++++++++++++ docs/programmers.sgml | 9 ++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/docs/designers.sgml b/docs/designers.sgml index 92b3f932..36ad681c 100644 --- a/docs/designers.sgml +++ b/docs/designers.sgml @@ -490,6 +490,27 @@ Topic: {$topic|truncate:40:"..."} {$articleTitle|@count} (this will print out the number of elements in the $articleTitle array.) + + Modifiers can be autoloaded from your $plugins_dir (also see: + Naming + Conventions) or can be registered explicitely (see: register_modifier). Additionally + all php-functions can be used as modifiers implicitely. (The + @count-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 + ({"%2.f"|sprintf:$float} actually works, but + asks for the more intuitive {For example: + $float|string_format:"%2.f"} that is provided by the + Smarty distribution). Second: with $security turned on all + php-functions that are to be used as modifiers have to be + declared trusted in the + $security_settings['MODIFIER_FUNCS']-array. + capitalize diff --git a/docs/programmers.sgml b/docs/programmers.sgml index 9291ae56..58fd0085 100644 --- a/docs/programmers.sgml +++ b/docs/programmers.sgml @@ -457,7 +457,6 @@ $smarty->autoload_filters = array('pre' => array('trim', 'stamp'), $request_use_auto_globals - 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->autoload_filters = array('pre' => array('trim', 'stamp'), linkend="variable.request.vars.order">variable.request.vars.order has no effect but php's configuration value gpc_order is used. - @@ -2495,9 +2493,10 @@ $smarty->default_template_handler_func = 'make_template'; depends on the order in which they are registered or loaded. - 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 plugins directory + 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.