From bdafb7ea6c23a9e57f5959a69041e4672ec15cb7 Mon Sep 17 00:00:00 2001 From: didou Date: Sun, 18 Apr 2004 19:22:55 +0000 Subject: [PATCH] WS, and switched to methodsynppsis --- .../api-functions/api-append-by-ref.xml | 79 ++++++------ .../programmers/api-functions/api-append.xml | 91 +++++++------- .../api-functions/api-assign-by-ref.xml | 66 +++++----- .../programmers/api-functions/api-assign.xml | 54 ++++---- .../api-functions/api-clear-all-assign.xml | 40 +++--- .../api-functions/api-clear-all-cache.xml | 44 ++++--- .../api-functions/api-clear-assign.xml | 44 ++++--- .../api-functions/api-clear-cache.xml | 63 +++++----- .../api-functions/api-clear-compiled-tpl.xml | 54 ++++---- .../api-functions/api-clear-config.xml | 40 +++--- .../api-functions/api-config-load.xml | 70 ++++++----- .../programmers/api-functions/api-display.xml | 117 +++++++++--------- .../programmers/api-functions/api-fetch.xml | 101 ++++++++------- .../api-functions/api-get-config-vars.xml | 40 +++--- .../api-get-registered-object.xml | 57 +++++---- .../api-functions/api-get-template-vars.xml | 40 +++--- .../api-functions/api-is-cached.xml | 72 ++++++----- .../api-functions/api-load-filter.xml | 52 ++++---- .../api-functions/api-register-block.xml | 99 ++++++++------- .../api-register-compiler-function.xml | 72 ++++++----- .../api-functions/api-register-function.xml | 95 +++++++------- .../api-functions/api-register-modifier.xml | 73 +++++------ .../api-functions/api-register-object.xml | 42 ++++--- .../api-register-outputfilter.xml | 62 +++++----- .../api-functions/api-register-postfilter.xml | 60 ++++----- .../api-functions/api-register-prefilter.xml | 60 ++++----- .../api-functions/api-register-resource.xml | 96 +++++++------- .../api-functions/api-template-exists.xml | 34 ++--- .../api-functions/api-trigger-error.xml | 38 +++--- .../api-functions/api-unregister-block.xml | 32 ++--- .../api-unregister-compiler-function.xml | 32 ++--- .../api-functions/api-unregister-function.xml | 42 ++++--- .../api-functions/api-unregister-modifier.xml | 42 ++++--- .../api-functions/api-unregister-object.xml | 30 +++-- .../api-unregister-outputfilter.xml | 30 +++-- .../api-unregister-postfilter.xml | 30 +++-- .../api-unregister-prefilter.xml | 30 +++-- .../api-functions/api-unregister-resource.xml | 42 ++++--- 38 files changed, 1165 insertions(+), 1000 deletions(-) diff --git a/docs/en/programmers/api-functions/api-append-by-ref.xml b/docs/en/programmers/api-functions/api-append-by-ref.xml index 02420c0a..b2caa1fb 100644 --- a/docs/en/programmers/api-functions/api-append-by-ref.xml +++ b/docs/en/programmers/api-functions/api-append-by-ref.xml @@ -1,41 +1,39 @@ - - append_by_ref - - - void append_by_ref - string varname - mixed var - - - void append_by_ref - string varname - mixed var - boolean merge - - - - This is used to append values to the templates by reference. - If you append a variable by reference then change its - value, the appended value sees the change as well. For objects, - append_by_ref() also avoids an in-memory copy of the appended object. - See the PHP manual on variable referencing for an in-depth - explanation. If you pass the optional third parameter of true, - the value will be merged with the current array instead of appended. - - - Technical Note - - The merge parameter respects array keys, so if you merge two - numerically indexed arrays, they may overwrite each other or result in - non-sequential keys. This is unlike the array_merge() function of PHP - which wipes out numerical keys and renumbers them. - - - - append_by_ref - + + + append_by_ref + + + + + <methodsynopsis> + <type>void</type><methodname>append_by_ref</methodname> + <methodparam><type>string</type><parameter>varname</parameter></methodparam> + <methodparam><type>mixed</type><parameter>var</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>merge</parameter></methodparam> + </methodsynopsis> + <para> + This is used to append values to the templates by reference. + If you append a variable by reference then change its + value, the appended value sees the change as well. For objects, + append_by_ref() also avoids an in-memory copy of the appended object. + See the PHP manual on variable referencing for an in-depth + explanation. If you pass the optional third parameter of true, + the value will be merged with the current array instead of appended. + </para> + <note> + <title>Technical Note + + The merge parameter respects array keys, so if + you merge two numerically indexed arrays, they may overwrite each other + or result in non-sequential keys. This is unlike the array_merge() function + of PHP which wipes out numerical keys and renumbers them. + + + + append_by_ref + append_by_ref("Name", $myname); $smarty->append_by_ref("Address", $address); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-append.xml b/docs/en/programmers/api-functions/api-append.xml index e8ea7665..eb0d0bda 100644 --- a/docs/en/programmers/api-functions/api-append.xml +++ b/docs/en/programmers/api-functions/api-append.xml @@ -1,57 +1,56 @@ - - append - - - void append - mixed var - - - void append - string varname - mixed var - - - void append - string varname - mixed var - boolean merge - - - - This is used to append an element to an assigned array. If you append - to a string value, it is converted to an array value and then - appended to. You can explicitly pass name/value pairs, or associative - arrays containing the name/value pairs. If you pass the optional third - parameter of true, the value will be merged with the current array - instead of appended. - - - Technical Note - - The merge parameter respects array keys, so if you merge two - numerically indexed arrays, they may overwrite each other or result in - non-sequential keys. This is unlike the array_merge() function of PHP - which wipes out numerical keys and renumbers them. - - - - append - + + + append + + + + + <methodsynopsis> + <type>void</type><methodname>append</methodname> + <methodparam><type>mixed</type><parameter>var</parameter></methodparam> + </methodsynopsis> + <methodsynopsis> + <type>void</type><methodname>append</methodname> + <methodparam><type>string</type><parameter>varname</parameter></methodparam> + <methodparam><type>mixed</type><parameter>var</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>merge</parameter></methodparam> + </methodsynopsis> + <para> + This is used to append an element to an assigned array. If you append + to a string value, it is converted to an array value and then + appended to. You can explicitly pass name/value pairs, or associative + arrays containing the name/value pairs. If you pass the optional third + parameter of true, the value will be merged with the current array + instead of appended. + </para> + <note> + <title>Technical Note + + The merge parameter respects array keys, so if you merge two + numerically indexed arrays, they may overwrite each other or result in + non-sequential keys. This is unlike the array_merge() function of PHP + which wipes out numerical keys and renumbers them. + + + + append + append("Name","Fred"); -$smarty->append("Address",$address); +$smarty->append("Name", "Fred"); +$smarty->append("Address", $address); // passing an associative array -$smarty->append(array("city" => "Lincoln","state" => "Nebraska")); +$smarty->append(array("city" => "Lincoln", "state" => "Nebraska")); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-assign-by-ref.xml b/docs/en/programmers/api-functions/api-assign-by-ref.xml index a86fa750..2b20b030 100644 --- a/docs/en/programmers/api-functions/api-assign-by-ref.xml +++ b/docs/en/programmers/api-functions/api-assign-by-ref.xml @@ -1,32 +1,35 @@ - - assign_by_ref - - - void assign_by_ref - string varname - mixed var - - - - This is used to assign values to the templates by reference instead of - making a copy. See the PHP manual on variable referencing for an explanation. - - - Technical Note - - This is used to assign values to the templates by reference. - If you assign a variable by reference then change its - value, the assigned value sees the change as well. For objects, - assign_by_ref() also avoids an in-memory copy of the assigned object. - See the PHP manual on variable referencing for an in-depth - explanation. - - - - assign_by_ref - + + + assign_by_ref + + + + + <methodsynopsis> + <type>void</type><methodname>assign_by_ref</methodname> + <methodparam><type>string</type><parameter>varname</parameter></methodparam> + <methodparam><type>mixed</type><parameter>var</parameter></methodparam> + </methodsynopsis> + <para> + This is used to assign values to the templates by reference instead of + making a copy. See the PHP manual on variable referencing for an explanation. + </para> + <note> + <title>Technical Note + + This is used to assign values to the templates by reference. + If you assign a variable by reference then change its + value, the assigned value sees the change as well. For objects, + assign_by_ref() also avoids an in-memory copy of the assigned object. + See the PHP manual on variable referencing for an in-depth + explanation. + + + + assign_by_ref + assign_by_ref('Name', $myname); $smarty->assign_by_ref('Address', $address); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-assign.xml b/docs/en/programmers/api-functions/api-assign.xml index 45051037..cc7d7e51 100644 --- a/docs/en/programmers/api-functions/api-assign.xml +++ b/docs/en/programmers/api-functions/api-assign.xml @@ -1,26 +1,29 @@ - - assign - - - void assign - mixed var - - - void assign - string varname - mixed var - - - - This is used to assign values to the templates. You can - explicitly pass name/value pairs, or associative arrays - containing the name/value pairs. - - - assign - + + + assign + + + + + <methodsynopsis> + <type>void</type><methodname>assign</methodname> + <methodparam><type>mixed</type><parameter>var</parameter></methodparam> + </methodsynopsis> + <methodsynopsis> + <type>void</type><methodname>assign</methodname> + <methodparam><type>string</type><parameter>varname</parameter></methodparam> + <methodparam><type>mixed</type><parameter>var</parameter></methodparam> + </methodsynopsis> + <para> + This is used to assign values to the templates. You can + explicitly pass name/value pairs, or associative arrays + containing the name/value pairs. + </para> + <example> + <title>assign + assign('Address', $address); $smarty->assign(array("city" => "Lincoln", "state" => "Nebraska")); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-clear-all-assign.xml b/docs/en/programmers/api-functions/api-clear-all-assign.xml index 6ab39a35..94ad2c8b 100644 --- a/docs/en/programmers/api-functions/api-clear-all-assign.xml +++ b/docs/en/programmers/api-functions/api-clear-all-assign.xml @@ -1,28 +1,32 @@ - - clear_all_assign - - - void clear_all_assign - - - - - This clears the values of all assigned variables. - - -clear_all_assign - + + + clear_all_assign + + + + + <methodsynopsis> + <type>void</type><methodname>clear_all_assign</methodname> + <void /> + </methodsynopsis> + <para> + This clears the values of all assigned variables. + </para> + <example> + <title>clear_all_assign + clear_all_assign(); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-clear-all-cache.xml b/docs/en/programmers/api-functions/api-clear-all-cache.xml index 6adcc83a..cb6c33ed 100644 --- a/docs/en/programmers/api-functions/api-clear-all-cache.xml +++ b/docs/en/programmers/api-functions/api-clear-all-cache.xml @@ -1,30 +1,34 @@ - - clear_all_cache - - - void clear_all_cache - int expire time - - - - This clears the entire template cache. As an optional - parameter, you can supply a minimum age in seconds the cache - files must be before they will get cleared. - - -clear_all_cache - + + + clear_all_cache + + + + + <methodsynopsis> + <type>void</type><methodname>clear_all_cache</methodname> + <methodparam choice="opt"><type>int</type><parameter>expire_time</parameter></methodparam> + </methodsynopsis> + <para> + This clears the entire template cache. As an optional + parameter, you can supply a minimum age in seconds the cache + files must be before they will get cleared. + </para> + <example> + <title>clear_all_cache + clear_all_cache(); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-clear-assign.xml b/docs/en/programmers/api-functions/api-clear-assign.xml index a7db906e..d7bede92 100644 --- a/docs/en/programmers/api-functions/api-clear-assign.xml +++ b/docs/en/programmers/api-functions/api-clear-assign.xml @@ -1,32 +1,36 @@ - - clear_assign - - - void clear_assign - string var - - - - This clears the value of an assigned variable. This - can be a single value, or an array of values. - - -clear_assign - + + + clear_assign + + + + + <methodsynopsis> + <type>void</type><methodname>clear_assign</methodname> + <methodparam><type>mixed</type><parameter>var</parameter></methodparam> + </methodsynopsis> + <para> + This clears the value of an assigned variable. This + can be a single value, or an array of values. + </para> + <example> + <title>clear_assign + clear_assign("Name"); // clear multiple variables -$smarty->clear_assign(array("Name","Address","Zip")); +$smarty->clear_assign(array("Name", "Address", "Zip")); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-clear-cache.xml b/docs/en/programmers/api-functions/api-clear-cache.xml index c035ed0e..13b45bae 100644 --- a/docs/en/programmers/api-functions/api-clear-cache.xml +++ b/docs/en/programmers/api-functions/api-clear-cache.xml @@ -1,40 +1,47 @@ - - clear_cache - - voidclear_cache - stringtemplate - stringcache id - stringcompile id - intexpire time - - - This clears the cache for a specific template. If you have - multiple caches for this template, you can clear a specific - cache by supplying the cache id as the second parameter. You - can also pass a compile id as a third parameter. You can "group" - templates together so they can be removed as a group. See the - caching section for more - information. As an optional fourth parameter, you can supply a - minimum age in seconds the cache file must be before it will - get cleared. - - -clear_cache - + + + clear_cache + + + + + <methodsynopsis> + <type>void</type><methodname>clear_cache</methodname> + <methodparam><type>string</type><parameter>template</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>expire_time</parameter></methodparam> + </methodsynopsis> + <para> + This clears the cache for a specific <parameter>template</parameter>. + If you have multiple caches for this template, you can clear a specific + cache by supplying the <parameter>cache_id</parameter> as the second + parameter. + You can also pass a <parameter>compile_id</parameter> as a third parameter. + You can "group" templates together so they can be removed as a group. See the + <link linkend="caching">caching section</link> for more + information. As an optional fourth parameter, you can supply a + minimum age in seconds the cache file must be before it will + get cleared. + </para> + <example> + <title>clear_cache + clear_cache("index.tpl"); // clear the cache for a particular cache id in an multiple-cache template -$smarty->clear_cache("index.tpl","CACHEID"); +$smarty->clear_cache("index.tpl", "CACHEID"); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-clear-compiled-tpl.xml b/docs/en/programmers/api-functions/api-clear-compiled-tpl.xml index f0fb325e..1a234fd0 100644 --- a/docs/en/programmers/api-functions/api-clear-compiled-tpl.xml +++ b/docs/en/programmers/api-functions/api-clear-compiled-tpl.xml @@ -1,25 +1,30 @@ - - clear_compiled_tpl - - voidclear_compiled_tpl - stringtpl_file - stringcompile_id - intexp_time - - - This clears the compiled version of the specified template - resource, or all compiled template files if one is not specified. - if you pass a compile_id only the compiled template for this - specific compile_id is cleared. if you pass an exp_time, then only - compiled templates older than exp_time seconds are cleared, by - default all compiled templates are cleared regardless of their age. - This function is for advanced use only, not normally needed. - - -clear_compiled_tpl - + + + clear_compiled_tpl + + + + + <methodsynopsis> + <type>void</type><methodname>clear_compiled_tpl</methodname> + <methodparam choice="opt"><type>string</type><parameter>tpl_file</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>exp_time</parameter></methodparam> + </methodsynopsis> + <para> + This clears the compiled version of the specified template + resource, or all compiled template files if one is not specified. + if you pass a compile_id only the compiled template for this + specific compile_id is cleared. if you pass an exp_time, then only + compiled templates older than exp_time seconds are cleared, by + default all compiled templates are cleared regardless of their age. + This function is for advanced use only, not normally needed. + </para> + <example> + <title>clear_compiled_tpl + clear_compiled_tpl("index.tpl"); $smarty->clear_compiled_tpl(); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-clear-config.xml b/docs/en/programmers/api-functions/api-clear-config.xml index 8492753b..bfd5676a 100644 --- a/docs/en/programmers/api-functions/api-clear-config.xml +++ b/docs/en/programmers/api-functions/api-clear-config.xml @@ -1,18 +1,23 @@ - - clear_config - - voidclear_config - stringvar - - - This clears all assigned config variables. If a variable name is - supplied, only that variable is cleared. - - -clear_config - + + + clear_config + + + + + <methodsynopsis> + <type>void</type><methodname>clear_config</methodname> + <methodparam choice="opt"><type>string</type><parameter>var</parameter></methodparam> + </methodsynopsis> + <para> + This clears all assigned config variables. If a variable name is + supplied, only that variable is cleared. + </para> + <example> + <title>clear_config + clear_config(); $smarty->clear_config('foobar'); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-config-load.xml b/docs/en/programmers/api-functions/api-config-load.xml index 6f1990ae..4da110af 100644 --- a/docs/en/programmers/api-functions/api-config-load.xml +++ b/docs/en/programmers/api-functions/api-config-load.xml @@ -1,44 +1,50 @@ - - config_load - - voidconfig_load - stringfile - stringsection - - - This loads config file data and assigns it to the template. This - works identical to the template config_load - function. - - - Technical Note - - As of Smarty 2.4.0, assigned template variables are kept across - invocations of fetch() and display(). Config vars loaded from - config_load() are always global scope. Config files are also - compiled for faster execution, and respect the force_compile and compile_check settings. - - - -config_load - + + + config_load + + + + + <methodsynopsis> + <type>void</type><methodname>config_load</methodname> + <methodparam><type>string</type><parameter>file</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>section</parameter></methodparam> + </methodsynopsis> + <para> + This loads config <parameter>file</parameter> data and assigns it to + the template. This works identical to the template <link + linkend="language.function.config.load">config_load</link> + function. + </para> + <note> + <title>Technical Note + + As of Smarty 2.4.0, assigned template variables are kept across + invocations of fetch() and display(). Config vars loaded from + config_load() are always global scope. Config files are also + compiled for faster execution, and respect the force_compile and compile_check settings. + + + + config_load + config_load('my.conf'); // load a section -$smarty->config_load('my.conf','foobar'); +$smarty->config_load('my.conf', 'foobar'); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-display.xml b/docs/en/programmers/api-functions/api-display.xml index 6e89601d..df48169b 100644 --- a/docs/en/programmers/api-functions/api-display.xml +++ b/docs/en/programmers/api-functions/api-display.xml @@ -1,35 +1,39 @@ - - display - - voiddisplay - stringtemplate - stringcache_id - stringcompile_id - - - This displays the template. Supply a valid template resource - type and path. As an optional second parameter, you can pass a - cache id. See the caching - section for more information. - - - As an optional third parameter, you can pass a compile id. This - is in the event that you want to compile different versions of - the same template, such as having separate templates compiled - for different languages. Another use for compile_id is when you - use more than one $template_dir but only one $compile_dir. Set - a separate compile_id for each $template_dir, otherwise - templates of the same name will overwrite each other. You can - also set the $compile_id variable once - instead of passing this to each call to display(). - - -display - + + + display + + + + + <methodsynopsis> + <type>void</type><methodname>display</methodname> + <methodparam><type>string</type><parameter>template</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam> + </methodsynopsis> + <para> + This displays the template. Supply a valid <link + linkend="template.resources">template resource</link> + type and path. As an optional second parameter, you can pass a + cache id. See the <link linkend="caching">caching + section</link> for more information. + </para> + <para> + As an optional third parameter, you can pass a compile id. This + is in the event that you want to compile different versions of + the same template, such as having separate templates compiled + for different languages. Another use for compile_id is when you + use more than one $template_dir but only one $compile_dir. Set + a separate compile_id for each $template_dir, otherwise + templates of the same name will overwrite each other. You can + also set the <link linkend="variable.compile.id">$compile_id</link> + variable once instead of passing this to each call to display(). + </para> + <example> + <title>display + caching = true; // only do db calls if cache doesn't exist -if(!$smarty->is_cached("index.tpl")) -{ +if(!$smarty->is_cached("index.tpl")) { - // dummy up some data - $address = "245 N 50th"; - $db_data = array( - "City" => "Lincoln", - "State" => "Nebraska", - "Zip" => "68502" - ); + // dummy up some data + $address = "245 N 50th"; + $db_data = array( + "City" => "Lincoln", + "State" => "Nebraska", + "Zip" => "68502" + ); - $smarty->assign("Name","Fred"); - $smarty->assign("Address",$address); - $smarty->assign($db_data); + $smarty->assign("Name","Fred"); + $smarty->assign("Address",$address); + $smarty->assign($db_data); } @@ -58,16 +61,16 @@ if(!$smarty->is_cached("index.tpl")) $smarty->display("index.tpl"); ?> ]]> - - - - Use the syntax for template resources to - display files outside of the $template_dir directory. - - -function display template resource examples - + + + + Use the syntax for template resources to + display files outside of the $template_dir directory. + + + function display template resource examples + display("file:C:/www/pub/templates/header.tpl"); $smarty->display("db:header.tpl"); ?> ]]> - - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-fetch.xml b/docs/en/programmers/api-functions/api-fetch.xml index e55b449f..aee2b4be 100644 --- a/docs/en/programmers/api-functions/api-fetch.xml +++ b/docs/en/programmers/api-functions/api-fetch.xml @@ -1,36 +1,42 @@ - - fetch - - stringfetch - stringtemplate - stringcache_id - stringcompile_id - - - This returns the template output instead of displaying it. - Supply a valid template resource - type and path. As an optional second parameter, you can pass a - cache id. See the caching - section for more information. - - - As an optional third parameter, you can pass a compile id. This - is in the event that you want to compile different versions of - the same template, such as having separate templates compiled - for different languages. Another use for compile_id is when you - use more than one $template_dir but only one $compile_dir. Set - a separate compile_id for each $template_dir, otherwise - templates of the same name will overwrite each other. You can - also set the $compile_id variable once - instead of passing this to each call to fetch(). - - -fetch - + + + fetch + + + + + <methodsynopsis> + <type>string</type><methodname>fetch</methodname> + <methodparam><type>string</type><parameter>template</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam> + </methodsynopsis> + <para> + This returns the template output instead of displaying it. + Supply a valid <link + linkend="template.resources">template resource</link> + type and path. As an optional second parameter, you can pass a + cache id. See the <link linkend="caching">caching + section</link> for more information. + </para> + <para> + As an optional third parameter, you can pass a compile id. This + is in the event that you want to compile different versions of + the same template, such as having separate templates compiled + for different languages. Another use for compile_id is when you + use more than one $template_dir but only one $compile_dir. Set + a separate compile_id for each $template_dir, otherwise + templates of the same name will overwrite each other. You can + also set the <link + linkend="variable.compile.id">$compile_id</link> variable once + instead of passing this to each call to fetch(). + </para> + <para> + <example> + <title>fetch + caching = true; // only do db calls if cache doesn't exist -if(!$smarty->is_cached("index.tpl")) -{ +if(!$smarty->is_cached("index.tpl")) { - // dummy up some data - $address = "245 N 50th"; - $db_data = array( - "City" => "Lincoln", - "State" => "Nebraska", - "Zip" => "68502" - ); + // dummy up some data + $address = "245 N 50th"; + $db_data = array( + "City" => "Lincoln", + "State" => "Nebraska", + "Zip" => "68502" + ); - $smarty->assign("Name","Fred"); - $smarty->assign("Address",$address); - $smarty->assign($db_data); + $smarty->assign("Name","Fred"); + $smarty->assign("Address",$address); + $smarty->assign($db_data); } @@ -64,9 +69,11 @@ $output = $smarty->fetch("index.tpl"); echo $output; ?> ]]> - - - + + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-get-config-vars.xml b/docs/en/programmers/api-functions/api-get-config-vars.xml index 8f725352..5465eea0 100644 --- a/docs/en/programmers/api-functions/api-get-config-vars.xml +++ b/docs/en/programmers/api-functions/api-get-config-vars.xml @@ -1,18 +1,23 @@ - - get_config_vars - - arrayget_config_vars - stringvarname - - - This returns the given loaded config variable value. If no parameter - is given, an array of all loaded config variables is returned. - - -get_config_vars - + + + get_config_vars + + + + + <methodsynopsis> + <type>array</type><methodname>get_config_vars</methodname> + <methodparam choice="opt"><type>string</type><parameter>varname</parameter></methodparam> + </methodsynopsis> + <para> + This returns the given loaded config variable value. If no parameter + is given, an array of all loaded config variables is returned. + </para> + <example> + <title>get_config_vars + get_config_vars(); print_r($config_vars); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-get-registered-object.xml b/docs/en/programmers/api-functions/api-get-registered-object.xml index 6b96d7dc..2a00ecd3 100644 --- a/docs/en/programmers/api-functions/api-get-registered-object.xml +++ b/docs/en/programmers/api-functions/api-get-registered-object.xml @@ -1,35 +1,40 @@ - - get_registered_object - - - array get_registered_object - string object_name - - - - This returns a reference to a registered object. This is useful - from within a custom function when you need direct access to a - registered object. - - -get_registered_object - + + + get_registered_object + + + + + <methodsynopsis> + <type>array</type><methodname>get_registered_object</methodname> + <methodparam><type>string</type><parameter>object_name</parameter></methodparam> + </methodsynopsis> + <para> + This returns a reference to a registered object. This is useful + from within a custom function when you need direct access to a + registered object. + </para> + <example> + <title>get_registered_object + get_registered_object($params['object']); - // use $obj_ref is now a reference to the object - } +function smarty_block_foo($params, &$smarty) +{ + if (isset($params['object'])) { + // get reference to registered object + $obj_ref = &$smarty->get_registered_object($params['object']); + // use $obj_ref is now a reference to the object + } } ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-get-template-vars.xml b/docs/en/programmers/api-functions/api-get-template-vars.xml index f2fc2add..e05c4813 100644 --- a/docs/en/programmers/api-functions/api-get-template-vars.xml +++ b/docs/en/programmers/api-functions/api-get-template-vars.xml @@ -1,18 +1,23 @@ - - get_template_vars - - arrayget_template_vars - stringvarname - - - This returns the given assigned variable value. If no parameter - is given, an array of all assigned variables is returned. - - -get_template_vars - + + + get_template_vars + + + + + <methodsynopsis> + <type>array</type><methodname>get_template_vars</methodname> + <methodparam choice="opt"><type>string</type><parameter>varname</parameter></methodparam> + </methodsynopsis> + <para> + This returns the given assigned variable value. If no parameter + is given, an array of all assigned variables is returned. + </para> + <example> + <title>get_template_vars + get_template_vars(); print_r($tpl_vars); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-is-cached.xml b/docs/en/programmers/api-functions/api-is-cached.xml index 711316a0..ff2265a9 100644 --- a/docs/en/programmers/api-functions/api-is-cached.xml +++ b/docs/en/programmers/api-functions/api-is-cached.xml @@ -1,56 +1,60 @@ - - is_cached - - - boolean is_cached - string template - [string cache_id] - - - - This returns true if there is a valid cache for this template. - This only works if caching is set to true. - - -is_cached - + + + is_cached + + + + + <methodsynopsis> + <type>bool</type><methodname>is_cached</methodname> + <methodparam><type>string</type><parameter>template</parameter></methodparam> + <methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam> + </methodsynopsis> + <para> + This returns &true; if there is a valid cache for this template. + This only works if <link + linkend="variable.caching">caching</link> is set to true. + </para> + <example> + <title>is_cached + caching = true; if(!$smarty->is_cached("index.tpl")) { - // do database calls, assign vars here +// do database calls, assign vars here } $smarty->display("index.tpl"); ?> ]]> - - - - You can also pass a cache id as an optional second parameter - in case you want multiple caches for the given template. - - -is_cached with multiple-cache template - + + + + You can also pass a cache id as an optional second parameter + in case you want multiple caches for the given template. + + + is_cached with multiple-cache template + caching = true; -if(!$smarty->is_cached("index.tpl","FrontPage")) { - // do database calls, assign vars here +if(!$smarty->is_cached("index.tpl", "FrontPage")) { + // do database calls, assign vars here } -$smarty->display("index.tpl","FrontPage"); +$smarty->display("index.tpl", "FrontPage"); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-load-filter.xml b/docs/en/programmers/api-functions/api-load-filter.xml index 98ef2a10..9cde5235 100644 --- a/docs/en/programmers/api-functions/api-load-filter.xml +++ b/docs/en/programmers/api-functions/api-load-filter.xml @@ -1,33 +1,37 @@ - - load_filter - - - void load_filter - string type - string name - - - - This function can be used to load a filter plugin. The first - argument specifies the type of the filter to load and can be one - of the following: 'pre', 'post', or 'output'. The second argument - specifies the name of the filter plugin, for example, 'trim'. - - -loading filter plugins - + + + load_filter + + + + + <methodsynopsis> + <type>void</type><methodname>load_filter</methodname> + <methodparam><type>string</type><parameter>type</parameter></methodparam> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + </methodsynopsis> + <para> + This function can be used to load a filter plugin. The first + argument specifies the type of the filter to load and can be one + of the following: 'pre', 'post', or 'output'. The second argument + specifies the name of the filter plugin, for example, 'trim'. + </para> + <example> + <title>loading filter plugins + load_filter('pre', 'trim'); // load prefilter named 'trim' -$smarty->load_filter('pre', 'datefooter'); // load another prefilter named 'datefooter' +$smarty->load_filter('pre', 'trim'); // load prefilter named 'trim' +$smarty->load_filter('pre', 'datefooter'); // load another prefilter named 'datefooter' $smarty->load_filter('output', 'compress'); // load output filter named 'compress' ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-register-block.xml b/docs/en/programmers/api-functions/api-register-block.xml index 2557fe37..81f5099b 100644 --- a/docs/en/programmers/api-functions/api-register-block.xml +++ b/docs/en/programmers/api-functions/api-register-block.xml @@ -1,61 +1,68 @@ - - register_block - - - void register_block - string name - mixed impl - bool cacheable - array or null cache_attrs - - - - Use this to dynamically register block functions plugins. - Pass in the block function name, followed by the PHP - function callback that implements it. - - - - The php-function callback impl can be either (a) a string - containing the function name or (b) an array of the form - array(&$object, $method) with - &$object being a reference to an - object and $method being a string - containing the mehod-name or (c) an array of the form - array(&$class, $method) with - $class being a classname and - $method being a class method of that - class. - - -$cacheable and $cache_attrs can be omitted in most cases. See Controlling Cacheability of Plugins' Output on how to use them properly. - - -register_block - + + + register_block + + + + + <methodsynopsis> + <type>void</type><methodname>register_block</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + <methodparam><type>mixed</type><parameter>impl</parameter></methodparam> + <methodparam><type>bool</type><parameter>cacheable</parameter></methodparam> + <methodparam><type>mixed</type><parameter>cache_attrs</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically register block functions plugins. + Pass in the block function name, followed by the PHP + function callback that implements it. + </para> + <para> + The php-function callback <parameter>impl</parameter> can be either (a) a string + containing the function name or (b) an array of the form + <literal>array(&$object, $method)</literal> with + <literal>&$object</literal> being a reference to an + object and <literal>$method</literal> being a string + containing the mehod-name or (c) an array of the form + <literal>array(&$class, $method)</literal> with + <literal>$class</literal> being a classname and + <literal>$method</literal> being a class method of that + class. + </para> + <para> + <parameter>cacheable</parameter> and <parameter>cache_attrs</parameter> + can be omitted in most cases. See <link + linkend="caching.cacheable">Controlling Cacheability of Plugins' Output</link> + on how to use them properly. + </para> + <example> + <title>register_block + register_block("translate", "do_translation"); -function do_translation ($params, $content, &$smarty, &$repeat) { - if (isset($content)) { - $lang = $params['lang']; - // do some translation with $content - return $translation; - } +function do_translation ($params, $content, &$smarty, &$repeat) +{ + if (isset($content)) { + $lang = $params['lang']; + // do some translation with $content + return $translation; + } } ?> {* template *} {translate lang="br"} - Hello, world! +Hello, world! {/translate} ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-register-compiler-function.xml b/docs/en/programmers/api-functions/api-register-compiler-function.xml index 35c0e588..84770e96 100644 --- a/docs/en/programmers/api-functions/api-register-compiler-function.xml +++ b/docs/en/programmers/api-functions/api-register-compiler-function.xml @@ -1,38 +1,42 @@ - - register_compiler_function - - - void register_compiler_function - string name - mixed impl - bool cacheable - - - - Use this to dynamically register a compiler function plugin. - Pass in the compiler function name, followed by the PHP - function that implements it. - - - The php-function callback impl can be either (a) a string - containing the function name or (b) an array of the form - array(&$object, $method) with - &$object being a reference to an - object and $method being a string - containing the mehod-name or (c) an array of the form - array(&$class, $method) with - $class being a classname and - $method being a class method of that - class. - - - $cacheable can be omitted in - most cases. See Controlling - Cacheability of Plugins' Output on how to it properly. - - + + + register_compiler_function + + + + + <methodsynopsis> + <type>bool</type><methodname>register_compiler_function</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + <methodparam><type>mixed</type><parameter>impl</parameter></methodparam> + <methodparam><type>bool</type><parameter>cacheable</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically register a compiler function plugin. + Pass in the compiler function name, followed by the PHP + function that implements it. + </para> + <para> + The php-function callback <parameter>impl</parameter> can be either (a) a string + containing the function name or (b) an array of the form + <literal>array(&$object, $method)</literal> with + <literal>&$object</literal> being a reference to an + object and <literal>$method</literal> being a string + containing the mehod-name or (c) an array of the form + <literal>array(&$class, $method)</literal> with + <literal>$class</literal> being a classname and + <literal>$method</literal> being a class method of that + class. + </para> + <para> + <parameter>cacheable</parameter> can be omitted in + most cases. See <link linkend="caching.cacheable">Controlling + Cacheability of Plugins' Output</link> on how to it properly. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -52,4 +56,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-register-function.xml b/docs/en/programmers/api-functions/api-register-function.xml index a984b886..458bde66 100644 --- a/docs/en/programmers/api-functions/api-register-function.xml +++ b/docs/en/programmers/api-functions/api-register-function.xml @@ -1,58 +1,67 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision$ --> - <sect1 id="api.register.function"> - <title>register_function - - - void register_function - string name - mixed impl - bool cacheable - array or null cache_attrs - - - - Use this to dynamically register template function plugins. - Pass in the template function name, followed by the PHP - function name that implements it. - - - The php-function callback impl can be either (a) a string - containing the function name or (b) an array of the form - array(&$object, $method) with - &$object being a reference to an - object and $method being a string - containing the mehod-name or (c) an array of the form - array(&$class, $method) with - $class being a classname and - $method being a class method of that - class. - - -$cacheable and $cache_attrs can be omitted in most cases. See Controlling Cacheability of Plugins' Output on how to use them properly. - - -register_function - + + + register_function + + + + + <methodsynopsis> + <type>void</type><methodname>register_function</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + <methodparam><type>mixed</type><parameter>impl</parameter></methodparam> + <methodparam><type>bool</type><parameter>cacheable</parameter></methodparam> + <methodparam><type>mixed</type><parameter>cache_attrs</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically register template function plugins. + Pass in the template function name, followed by the PHP + function name that implements it. + </para> + <para> + The php-function callback <parameter>impl</parameter> can be either (a) a string + containing the function name or (b) an array of the form + <literal>array(&$object, $method)</literal> with + <literal>&$object</literal> being a reference to an + object and <literal>$method</literal> being a string + containing the mehod-name or (c) an array of the form + <literal>array(&$class, $method)</literal> with + <literal>$class</literal> being a classname and + <literal>$method</literal> being a class method of that + class. + </para> + <para> + <parameter>cacheable</parameter> and <parameter>cache_attrs</parameter> can be + omitted in most cases. See <link + linkend="caching.cacheable">Controlling Cacheability of Plugins' Output</link> + on how to use them properly. + </para> + <example> + <title>register_function + register_function("date_now", "print_current_date"); -function print_current_date ($params) { - if(empty($params['format'])) - $format = "%b %e, %Y"; - else - $format = $params['format']; +function print_current_date($params) +{ + if(empty($params['format'])) { + $format = "%b %e, %Y"; + } else { + $format = $params['format']; return strftime($format,time()); + } } // now you can use this in Smarty to print the current date: {date_now} // or, {date_now format="%Y/%m/%d"} to format it. ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-register-modifier.xml b/docs/en/programmers/api-functions/api-register-modifier.xml index ed1fc881..7bbcc275 100644 --- a/docs/en/programmers/api-functions/api-register-modifier.xml +++ b/docs/en/programmers/api-functions/api-register-modifier.xml @@ -1,47 +1,50 @@ - - register_modifier - - - void register_modifier - string name - mixed impl - - - - Use this to dynamically register modifier plugin. Pass in the - template modifier name, followed by the PHP function that it - implements it. - - - The php-function callback impl can be either (a) a string - containing the function name or (b) an array of the form - array(&$object, $method) with - &$object being a reference to an - object and $method being a string - containing the mehod-name or (c) an array of the form - array(&$class, $method) with - $class being a classname and - $method being a class method of that - class. - - - -register_modifier - + + + register_modifier + + + + + <methodsynopsis> + <type>void</type><methodname>register_modifier</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + <methodparam><type>mixed</type><parameter>impl</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically register modifier plugin. Pass in the + template modifier name, followed by the PHP function that it + implements it. + </para> + <para> + The php-function callback <parameter>impl</parameter> can be either (a) a string + containing the function name or (b) an array of the form + <literal>array(&$object, $method)</literal> with + <literal>&$object</literal> being a reference to an + object and <literal>$method</literal> being a string + containing the mehod-name or (c) an array of the form + <literal>array(&$class, $method)</literal> with + <literal>$class</literal> being a classname and + <literal>$method</literal> being a class method of that + class. + </para> + <example> + <title>register_modifier + register_modifier("sslash","stripslashes"); +$smarty->register_modifier("sslash", "stripslashes"); // now you can use {$var|sslash} to strip slashes from variables ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-register-object.xml b/docs/en/programmers/api-functions/api-register-object.xml index b0fd6c86..7992df4a 100644 --- a/docs/en/programmers/api-functions/api-register-object.xml +++ b/docs/en/programmers/api-functions/api-register-object.xml @@ -1,23 +1,27 @@ - - register_object - - - void register_object - string object_name - object $object - array allowed methods/properties - boolean format - array block methods - - - - This is to register an object for use in the templates. See the - object section - of the manual for examples. - - + + + register_object + + + + + <methodsynopsis> + <type>void</type><methodname>register_object</methodname> + <methodparam><type>string</type><parameter>object_name</parameter></methodparam> + <methodparam><type>object</type><parameter>object</parameter></methodparam> + <methodparam><type>array</type><parameter>allowed_methods_properties</parameter></methodparam> + <methodparam><type>boolean</type><parameter>format</parameter></methodparam> + <methodparam><type>array</type><parameter>block_methods</parameter></methodparam> + </methodsynopsis> + <para> + This is to register an object for use in the templates. See the + <link linkend="advanced.features.objects">object section</link> + of the manual for examples. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -37,4 +41,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-register-outputfilter.xml b/docs/en/programmers/api-functions/api-register-outputfilter.xml index 6d5db988..b9433f4c 100644 --- a/docs/en/programmers/api-functions/api-register-outputfilter.xml +++ b/docs/en/programmers/api-functions/api-register-outputfilter.xml @@ -1,33 +1,37 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision$ --> - <sect1 id="api.register.outputfilter"> - <title>register_outputfilter - - - void register_outputfilter - mixed function - - - - Use this to dynamically register outputfilters to operate on - a template's output before it is displayed. See - template output - filters - for more information on how to set up an output filter function. - - - The php-function callback function can be either (a) a string - containing the function name or (b) an array of the form - array(&$object, $method) with - &$object being a reference to an - object and $method being a string - containing the mehod-name or (c) an array of the form - array(&$class, $method) with - $class being a classname and - $method being a class method of that - class. - - + + + register_outputfilter + + + + + <methodsynopsis> + <type>void</type><methodname>register_outputfilter</methodname> + <methodparam><type>mixed</type><parameter>function</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically register outputfilters to operate on + a template's output before it is displayed. See + <link linkend="advanced.features.outputfilters">template output + filters</link> + for more information on how to set up an output filter function. + </para> + <para> + The php-function callback <parameter>function</parameter> can be either (a) a string + containing the function name or (b) an array of the form + <literal>array(&$object, $method)</literal> with + <literal>&$object</literal> being a reference to an + object and <literal>$method</literal> being a string + containing the mehod-name or (c) an array of the form + <literal>array(&$class, $method)</literal> with + <literal>$class</literal> being a classname and + <literal>$method</literal> being a class method of that + class. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -47,4 +51,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-register-postfilter.xml b/docs/en/programmers/api-functions/api-register-postfilter.xml index 2639604f..81b16bb7 100644 --- a/docs/en/programmers/api-functions/api-register-postfilter.xml +++ b/docs/en/programmers/api-functions/api-register-postfilter.xml @@ -1,32 +1,36 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision$ --> - <sect1 id="api.register.postfilter"> - <title>register_postfilter - - - void register_postfilter - mixed function - - - - Use this to dynamically register postfilters to run templates - through after they are compiled. See template postfilters for - more information on how to setup a postfiltering function. - - - The php-function callback function can be either (a) a string - containing the function name or (b) an array of the form - array(&$object, $method) with - &$object being a reference to an - object and $method being a string - containing the mehod-name or (c) an array of the form - array(&$class, $method) with - $class being a classname and - $method being a class method of that - class. - - + + + register_postfilter + + + + + <methodsynopsis> + <type>void</type><methodname>register_postfilter</methodname> + <methodparam><type>mixed</type><parameter>function</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically register postfilters to run templates + through after they are compiled. See <link + linkend="advanced.features.postfilters">template postfilters</link> for + more information on how to setup a postfiltering function. + </para> + <para> + The php-function callback <parameter>function</parameter> can be either (a) a string + containing the function name or (b) an array of the form + <literal>array(&$object, $method)</literal> with + <literal>&$object</literal> being a reference to an + object and <literal>$method</literal> being a string + containing the mehod-name or (c) an array of the form + <literal>array(&$class, $method)</literal> with + <literal>$class</literal> being a classname and + <literal>$method</literal> being a class method of that + class. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -46,4 +50,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-register-prefilter.xml b/docs/en/programmers/api-functions/api-register-prefilter.xml index bb3c7dfc..a9fe5dc7 100644 --- a/docs/en/programmers/api-functions/api-register-prefilter.xml +++ b/docs/en/programmers/api-functions/api-register-prefilter.xml @@ -1,32 +1,36 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision$ --> - <sect1 id="api.register.prefilter"> - <title>register_prefilter - - - void register_prefilter - mixed function - - - - Use this to dynamically register prefilters to run templates - through before they are compiled. See template prefilters for - more information on how to setup a prefiltering function. - - - The php-function callback function can be either (a) a string - containing the function name or (b) an array of the form - array(&$object, $method) with - &$object being a reference to an - object and $method being a string - containing the mehod-name or (c) an array of the form - array(&$class, $method) with - $class being a classname and - $method being a class method of that - class. - - + + + register_prefilter + + + + + <methodsynopsis> + <type>void</type><methodname>register_prefilter</methodname> + <methodparam><type>mixed</type><parameter>function</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically register prefilters to run templates + through before they are compiled. See <link + linkend="advanced.features.prefilters">template prefilters</link> for + more information on how to setup a prefiltering function. + </para> + <para> + The php-function callback <parameter>function</parameter> can be either (a) a string + containing the function name or (b) an array of the form + <literal>array(&$object, $method)</literal> with + <literal>&$object</literal> being a reference to an + object and <literal>$method</literal> being a string + containing the mehod-name or (c) an array of the form + <literal>array(&$class, $method)</literal> with + <literal>$class</literal> being a classname and + <literal>$method</literal> being a class method of that + class. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -46,4 +50,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-register-resource.xml b/docs/en/programmers/api-functions/api-register-resource.xml index 31885209..81b64f3d 100644 --- a/docs/en/programmers/api-functions/api-register-resource.xml +++ b/docs/en/programmers/api-functions/api-register-resource.xml @@ -1,55 +1,59 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision$ --> - <sect1 id="api.register.resource"> - <title>register_resource - - - void register_resource - string name - array resource_funcs - - - - Use this to dynamically register a resource plugin with Smarty. - Pass in the name of the resource and the array of PHP functions - implementing it. See - template resources - for more information on how to setup a function for fetching - templates. - - - Technical Note - - A resource name must be at least two characters in length. One - character resource names will be ignored and used as part of the file - path, such as $smarty->display('c:/path/to/index.tpl'); - - - - The php-function-array resource_funcs - must have 4 or 5 elements. With 4 elements the elements are - the functions-callbacks for the respective "source", - "timestamp", "secure" and "trusted" functions of the - resource. With 5 elements the first element has to be an - object reference or a class name of the object or class - implementing the resource and the 4 following elements have - to be the method names implementing "source", "timestamp", - "secure" and "trusted". - - -register_resource - + + + register_resource + + + + + <methodsynopsis> + <type>void</type><methodname>register_resource</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + <methodparam><type>array</type><parameter>resource_funcs</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically register a resource plugin with Smarty. + Pass in the name of the resource and the array of PHP functions + implementing it. See + <link linkend="template.resources">template resources</link> + for more information on how to setup a function for fetching + templates. + </para> + <note> + <title>Technical Note + + A resource name must be at least two characters in length. One + character resource names will be ignored and used as part of the file + path, such as $smarty->display('c:/path/to/index.tpl'); + + + + The php-function-array resource_funcs + must have 4 or 5 elements. With 4 elements the elements are + the functions-callbacks for the respective "source", + "timestamp", "secure" and "trusted" functions of the + resource. With 5 elements the first element has to be an + object reference or a class name of the object or class + implementing the resource and the 4 following elements have + to be the method names implementing "source", "timestamp", + "secure" and "trusted". + + + register_resource + register_resource("db", array("db_get_template", - "db_get_timestamp", - "db_get_secure", - "db_get_trusted")); +"db_get_timestamp", +"db_get_secure", +"db_get_trusted")); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-template-exists.xml b/docs/en/programmers/api-functions/api-template-exists.xml index 1e9e32e4..47f5a002 100644 --- a/docs/en/programmers/api-functions/api-template-exists.xml +++ b/docs/en/programmers/api-functions/api-template-exists.xml @@ -1,19 +1,23 @@ - - template_exists - - - bool template_exists - string template - - - - This function checks whether the specified template exists. It can - accept either a path to the template on the filesystem or a - resource string specifying the template. - - + + + template_exists + + + + + <methodsynopsis> + <type>bool</type><methodname>template_exists</methodname> + <methodparam><type>string</type><parameter>template</parameter></methodparam> + </methodsynopsis> + <para> + This function checks whether the specified template exists. It can + accept either a path to the template on the filesystem or a + resource string specifying the template. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -33,4 +37,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-trigger-error.xml b/docs/en/programmers/api-functions/api-trigger-error.xml index 7e779e00..a6e3a0b7 100644 --- a/docs/en/programmers/api-functions/api-trigger-error.xml +++ b/docs/en/programmers/api-functions/api-trigger-error.xml @@ -1,21 +1,25 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision$ --> - <sect1 id="api.trigger.error"> - <title>trigger_error - - - void trigger_error - string error_msg - [int level] - - - - This function can be used to output an error message using Smarty. - level parameter can be one of the values - used for trigger_error() PHP function, i.e. E_USER_NOTICE, - E_USER_WARNING, etc. By default it's E_USER_WARNING. - - + + + trigger_error + + + + + <methodsynopsis> + <type>void</type><methodname>trigger_error</methodname> + <methodparam><type>string</type><parameter>error_msg</parameter></methodparam> + <methodparam choice="opt"><type>int</type><parameter>level</parameter></methodparam> + </methodsynopsis> + <para> + This function can be used to output an error message using Smarty. + <parameter>level</parameter> parameter can be one of the values + used for trigger_error() PHP function, i.e. E_USER_NOTICE, + E_USER_WARNING, etc. By default it's E_USER_WARNING. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -35,4 +39,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-unregister-block.xml b/docs/en/programmers/api-functions/api-unregister-block.xml index ea7be58e..ceff8082 100644 --- a/docs/en/programmers/api-functions/api-unregister-block.xml +++ b/docs/en/programmers/api-functions/api-unregister-block.xml @@ -1,18 +1,22 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision$ --> - <sect1 id="api.unregister.block"> - <title>unregister_block - - - void unregister_block - string name - - - - Use this to dynamically unregister block function plugin. - Pass in the block function name. - - + + + unregister_block + + + + + <methodsynopsis> + <type>void</type><methodname>unregister_block</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically unregister block function plugin. + Pass in the block function <parameter>name</parameter>. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -32,4 +36,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-unregister-compiler-function.xml b/docs/en/programmers/api-functions/api-unregister-compiler-function.xml index 1b21c409..3ac88dca 100644 --- a/docs/en/programmers/api-functions/api-unregister-compiler-function.xml +++ b/docs/en/programmers/api-functions/api-unregister-compiler-function.xml @@ -1,18 +1,22 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision$ --> - <sect1 id="api.unregister.compiler.function"> - <title>unregister_compiler_function - - - void unregister_compiler_function - string name - - - - Use this to dynamically unregister a compiler function. Pass in - the name of the compiler function. - - + + + unregister_compiler_function + + + + + <methodsynopsis> + <type>void</type><methodname>unregister_compiler_function</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically unregister a compiler function. Pass in + the <parameter>name</parameter> of the compiler function. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -32,4 +36,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-unregister-function.xml b/docs/en/programmers/api-functions/api-unregister-function.xml index 1c5e1546..f5a79588 100644 --- a/docs/en/programmers/api-functions/api-unregister-function.xml +++ b/docs/en/programmers/api-functions/api-unregister-function.xml @@ -1,20 +1,23 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision$ --> - <sect1 id="api.unregister.function"> - <title>unregister_function - - - void unregister_function - string name - - - - Use this to dynamically unregister template function plugin. - Pass in the template function name. - - -unregister_function - + + + unregister_function + + + + + <methodsynopsis> + <type>void</type><methodname>unregister_function</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically unregister template function plugin. + Pass in the template function name. + </para> + <example> + <title>unregister_function + unregister_function("fetch"); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-unregister-modifier.xml b/docs/en/programmers/api-functions/api-unregister-modifier.xml index a53ed1e7..ced96c26 100644 --- a/docs/en/programmers/api-functions/api-unregister-modifier.xml +++ b/docs/en/programmers/api-functions/api-unregister-modifier.xml @@ -1,20 +1,23 @@ - - unregister_modifier - - - void unregister_modifier - string name - - - - Use this to dynamically unregister modifier plugin. Pass in the - template modifier name. - - -unregister_modifier - + + + unregister_modifier + + + + + <methodsynopsis> + <type>void</type><methodname>unregister_modifier</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically unregister modifier plugin. Pass in the + template modifier name. + </para> + <example> + <title>unregister_modifier + unregister_modifier("strip_tags"); ?> ]]> - - - + + + + \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-unregister-object.xml b/docs/en/programmers/api-functions/api-unregister-object.xml index d9007b0f..613b0ecf 100644 --- a/docs/en/programmers/api-functions/api-unregister-object.xml +++ b/docs/en/programmers/api-functions/api-unregister-object.xml @@ -1,17 +1,21 @@ - - unregister_object - - - void unregister_object - string object_name - - - - Use this to unregister an object. - - + + + unregister_object + + + + + <methodsynopsis> + <type>void</type><methodname>unregister_object</methodname> + <methodparam><type>string</type><parameter>object_name</parameter></methodparam> + </methodsynopsis> + <para> + Use this to unregister an object. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -31,4 +35,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-unregister-outputfilter.xml b/docs/en/programmers/api-functions/api-unregister-outputfilter.xml index c3438f7d..bf38b08f 100644 --- a/docs/en/programmers/api-functions/api-unregister-outputfilter.xml +++ b/docs/en/programmers/api-functions/api-unregister-outputfilter.xml @@ -1,17 +1,21 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision$ --> - <sect1 id="api.unregister.outputfilter"> - <title>unregister_outputfilter - - - void unregister_outputfilter - string function_name - - - - Use this to dynamically unregister an output filter. - - + + + unregister_outputfilter + + + + + <methodsynopsis> + <type>void</type><methodname>unregister_outputfilter</methodname> + <methodparam><type>string</type><parameter>function_name</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically unregister an output filter. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -31,4 +35,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-unregister-postfilter.xml b/docs/en/programmers/api-functions/api-unregister-postfilter.xml index cca256d1..ebd726cd 100644 --- a/docs/en/programmers/api-functions/api-unregister-postfilter.xml +++ b/docs/en/programmers/api-functions/api-unregister-postfilter.xml @@ -1,17 +1,21 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision$ --> - <sect1 id="api.unregister.postfilter"> - <title>unregister_postfilter - - - void unregister_postfilter - string function_name - - - - Use this to dynamically unregister a postfilter. - - + + + unregister_postfilter + + + + + <methodsynopsis> + <type>void</type><methodname>unregister_postfilter</methodname> + <methodparam><type>string</type><parameter>function_name</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically unregister a postfilter. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -31,4 +35,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-unregister-prefilter.xml b/docs/en/programmers/api-functions/api-unregister-prefilter.xml index 60be265a..070b6e08 100644 --- a/docs/en/programmers/api-functions/api-unregister-prefilter.xml +++ b/docs/en/programmers/api-functions/api-unregister-prefilter.xml @@ -1,17 +1,21 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision$ --> - <sect1 id="api.unregister.prefilter"> - <title>unregister_prefilter - - - void unregister_prefilter - string function_name - - - - Use this to dynamically unregister a prefilter. - - + + + unregister_prefilter + + + + + <methodsynopsis> + <type>void</type><methodname>unregister_prefilter</methodname> + <methodparam><type>string</type><parameter>function_name</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically unregister a prefilter. + </para> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -31,4 +35,4 @@ End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 ---> \ No newline at end of file +--> diff --git a/docs/en/programmers/api-functions/api-unregister-resource.xml b/docs/en/programmers/api-functions/api-unregister-resource.xml index 00656004..8c659196 100644 --- a/docs/en/programmers/api-functions/api-unregister-resource.xml +++ b/docs/en/programmers/api-functions/api-unregister-resource.xml @@ -1,28 +1,32 @@ <?xml version="1.0" encoding="iso-8859-1"?> <!-- $Revision$ --> - <sect1 id="api.unregister.resource"> - <title>unregister_resource - - - void unregister_resource - string name - - - - Use this to dynamically unregister a resource plugin. Pass in the - name of the resource. - - -unregister_resource - + + + unregister_resource + + + + + <methodsynopsis> + <type>void</type><methodname>unregister_resource</methodname> + <methodparam><type>string</type><parameter>name</parameter></methodparam> + </methodsynopsis> + <para> + Use this to dynamically unregister a resource plugin. Pass in the + name of the resource. + </para> + <example> + <title>unregister_resource + unregister_resource("db"); ?> ]]> - - - + + + + \ No newline at end of file +-->