From 0e060d2341a44998213637e471dd61a5738bf69c Mon Sep 17 00:00:00 2001 From: didou Date: Fri, 26 Mar 2004 14:38:16 +0000 Subject: [PATCH] fix livedocs build # s/&/\&/g --- docs/en/appendixes.xml | 2 +- docs/en/designers.xml | 20 +++--- docs/en/programmers.xml | 136 ++++++++++++++++++++-------------------- 3 files changed, 80 insertions(+), 78 deletions(-) diff --git a/docs/en/appendixes.xml b/docs/en/appendixes.xml index 85230d5e..0e5c1dd9 100644 --- a/docs/en/appendixes.xml +++ b/docs/en/appendixes.xml @@ -58,7 +58,7 @@ Parse error: parse error in /path/to/smarty/templates_c/index.tpl.php on line 75 - Tips & Tricks + Tips & Tricks diff --git a/docs/en/designers.xml b/docs/en/designers.xml index ea6985ba..edd382c8 100644 --- a/docs/en/designers.xml +++ b/docs/en/designers.xml @@ -57,17 +57,20 @@ function syntax +{$name}! {else} - Welcome, {$name}! + Welcome, {$name}! {/if} -{include file="footer.tpl"} +{include file="footer.tpl"} +]]> + Both built-in functions and custom functions have the same syntax in @@ -1069,7 +1072,7 @@ index.tpl: {$articleTitle} {$articleTitle|escape} -{$articleTitle|escape:"html"} {* escapes & " ' < > *} +{$articleTitle|escape:"html"} {* escapes & " ' < > *} {$articleTitle|escape:"htmlall"} {* escapes ALL html entities *} {$articleTitle|escape:"url"} {$articleTitle|escape:"quotes"} @@ -1267,7 +1270,7 @@ $smarty->display('index.tpl'); index.tpl: -{* replace each carriage return, tab & new line with a space *} +{* replace each carriage return, tab & new line with a space *} {$articleTitle} {$articleTitle|regex_replace:"/[\r\t\n]/":" "} @@ -2480,7 +2483,7 @@ index.tpl {/if}. {else} and {elseif} are also permitted. All PHP conditionals are recognized, such as ||, or, - &&, and, etc. + &&, and, etc. @@ -3731,7 +3734,7 @@ index.tpl OUTPUT: This is the contents of foo. -Welcome to Foobar Pub & Grill's home page! +Welcome to Foobar Pub & Grill's home page! You must supply a <b>city</b>. You must supply a <b>state</b>. @@ -5325,8 +5328,7 @@ OUTPUT: 9%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d% 61%69%6e%2e%63%6f%6d%22%20%3e%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%3c%2f%61%3e %27%29%3b'))</script> -<a href="mailto:%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d" >me@d& -#x6f;main.com</a> +<a href="mailto:%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d" >me@domain.com</a> <a href="mailto:me@domain.com?subject=Hello%20to%20you%21" >me@domain.com</a> <a href="mailto:me@domain.com?cc=you@domain.com%2Cthey@domain.com" >me@domain.com</a> <a href="mailto:me@domain.com" class="email">me@domain.com</a> diff --git a/docs/en/programmers.xml b/docs/en/programmers.xml index cd3c90b5..c8d6a9cd 100644 --- a/docs/en/programmers.xml +++ b/docs/en/programmers.xml @@ -1085,10 +1085,10 @@ print_r($config_vars); &get_registered_object($params['object']); + $obj_ref = &$smarty->&get_registered_object($params['object']); // use $obj_ref is now a reference to the object } } @@ -1224,11 +1224,11 @@ $smarty->load_filter('output', 'compress'); // load output filter named 'compres 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 + 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 + array(&$class, $method) with $class being a classname and $method being a class method of that class. @@ -1243,7 +1243,7 @@ $smarty->load_filter('output', 'compress'); // load output filter named 'compres register_block("translate", "do_translation"); -function do_translation ($params, $content, &$smarty, &$repeat) { +function do_translation ($params, $content, &$smarty, &$repeat) { if (isset($content)) { $lang = $params['lang']; // do some translation with $content @@ -1278,11 +1278,11 @@ function do_translation ($params, $content, &$smarty, &$repeat) { 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 + 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 + array(&$class, $method) with $class being a classname and $method being a class method of that class. @@ -1312,11 +1312,11 @@ function do_translation ($params, $content, &$smarty, &$repeat) { 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 + 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 + array(&$class, $method) with $class being a classname and $method being a class method of that class. @@ -1363,11 +1363,11 @@ function print_current_date ($params) { 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 + 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 + array(&$class, $method) with $class being a classname and $method being a class method of that class. @@ -1424,11 +1424,11 @@ $smarty->register_modifier("sslash","stripslashes"); 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 + 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 + array(&$class, $method) with $class being a classname and $method being a class method of that class. @@ -1451,11 +1451,11 @@ $smarty->register_modifier("sslash","stripslashes"); 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 + 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 + array(&$class, $method) with $class being a classname and $method being a class method of that class. @@ -1478,11 +1478,11 @@ $smarty->register_modifier("sslash","stripslashes"); 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 + 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 + array(&$class, $method) with $class being a classname and $method being a class method of that class. @@ -2077,7 +2077,7 @@ require('Smarty.class.php'); $smarty = new Smarty; $smarty->caching = true; -function remaining_seconds($params, &$smarty) { +function remaining_seconds($params, &$smarty) { $remain = $params['endtime'] - time(); if ($remain >=0) return $remain . " second(s)"; @@ -2118,7 +2118,7 @@ require('Smarty.class.php'); $smarty = new Smarty; $smarty->caching = true; -function smarty_block_dynamic($param, $content, &$smarty) { +function smarty_block_dynamic($param, $content, &$smarty) { return $content; } $smarty->register_block('dynamic', 'smarty_block_dynamic', false); @@ -2191,8 +2191,8 @@ When reloading the page you will notice that both dates differ. One is "dynamic" parameters for block-function-plugins: They get 4 parameters $params, $content, - &$smarty and - &$repeat and they also behave like + &$smarty and + &$repeat and they also behave like block-function-plugins. @@ -2203,7 +2203,7 @@ When reloading the page you will notice that both dates differ. One is "dynamic" // the object class My_Object { - function meth1($params, &$smarty_obj) { + function meth1($params, &$smarty_obj) { return "this is my meth1"; } } @@ -2258,7 +2258,7 @@ the output was {$output} /U","",$tpl_source); } @@ -2295,7 +2295,7 @@ $smarty->display("index.tpl"); ;\n\" ?>;\n".$tpl_source; } @@ -2339,7 +2339,7 @@ $smarty->display("index.tpl"); display("file:F:/path/to/my/templates/menu.tpl"); display("db:index.tpl"); _get_plugin_filepath('function', 'html_options');&$repeat after the Smarty object to keep + &$repeat after the Smarty object to keep backwards compatibility to older versions of Smarty). @@ -2844,7 +2844,7 @@ require_once $smarty->_get_plugin_filepath('function', 'html_options'); void smarty_function_name array $params - object &$smarty + object &$smarty @@ -2883,7 +2883,7 @@ require_once $smarty->_get_plugin_filepath('function', 'html_options');trigger_error("assign: missing 'var' parameter"); @@ -3042,7 +3042,7 @@ function smarty_modifier_truncate($string, $length = 80, $etc = '...', void smarty_block_name array $params mixed $content - object &$smarty + object &$smarty @@ -3055,7 +3055,7 @@ function smarty_modifier_truncate($string, $length = 80, $etc = '...', By default your function implementation is called twice by Smarty: once for the opening tag, and once for the closing tag - (see &$repeat below how to change this). + (see &$repeat below how to change this). Only the opening tag of the block function may have attributes. All @@ -3076,7 +3076,7 @@ function smarty_modifier_truncate($string, $length = 80, $etc = '...', - The parameter &$repeat is passed by + The parameter &$repeat is passed by reference to the function implementation and provides a possibility for it to control how many times the block is displayed. By default $repeat is @@ -3084,7 +3084,7 @@ function smarty_modifier_truncate($string, $length = 80, $etc = '...', (the block opening tag) and false on all subsequent calls to the block function (the block's closing tag). Each time the function implementation returns with - &$repeat being true, the contents between + &$repeat being true, the contents between {func} .. {/func} are evaluated and the function implementation is called again with the new block contents in the parameter $content. @@ -3116,7 +3116,7 @@ function smarty_modifier_truncate($string, $length = 80, $etc = '...', * Purpose: translate a block of text * ------------------------------------------------------------- */ -function smarty_block_translate($params, $content, &$smarty) +function smarty_block_translate($params, $content, &$smarty) { if (isset($content)) { $lang = $params['lang']; @@ -3142,7 +3142,7 @@ function smarty_block_translate($params, $content, &$smarty) mixed smarty_compiler_name string $tag_arg - object &$smarty + object &$smarty @@ -3171,7 +3171,7 @@ function smarty_block_translate($params, $content, &$smarty) * the time it was compiled. * ------------------------------------------------------------- */ -function smarty_compiler_tplheader($tag_arg, &$smarty) +function smarty_compiler_tplheader($tag_arg, &$smarty) { return "\necho '" . $smarty->_current_file . " compiled at " . date('Y-m-d H:M'). "';"; } @@ -3209,7 +3209,7 @@ echo 'index.tpl compiled at 2002-02-20 20:02'; string smarty_prefilter_name string $source - object &$smarty + object &$smarty @@ -3223,7 +3223,7 @@ echo 'index.tpl compiled at 2002-02-20 20:02'; string smarty_postfilter_name string $compiled - object &$smarty + object &$smarty @@ -3248,7 +3248,7 @@ echo 'index.tpl compiled at 2002-02-20 20:02'; * Purpose: Convert html tags to be lowercase. * ------------------------------------------------------------- */ - function smarty_prefilter_pre01($source, &$smarty) + function smarty_prefilter_pre01($source, &$smarty) { return preg_replace('!<(\w+)[^>]+>!e', 'strtolower("$1")', $source); } @@ -3271,7 +3271,7 @@ echo 'index.tpl compiled at 2002-02-20 20:02'; * Purpose: Output code that lists all current template vars. * ------------------------------------------------------------- */ - function smarty_postfilter_post01($compiled, &$smarty) + function smarty_postfilter_post01($compiled, &$smarty) { $compiled = "
\nget_template_vars()); ?>\n
" . $compiled; return $compiled; @@ -3291,7 +3291,7 @@ echo 'index.tpl compiled at 2002-02-20 20:02'; string smarty_outputfilter_name string $template_output - object &$smarty + object &$smarty @@ -3315,7 +3315,7 @@ echo 'index.tpl compiled at 2002-02-20 20:02'; * a simple protection against spambots * ------------------------------------------------------------- */ - function smarty_outputfilter_protect_email($output, &$smarty) + function smarty_outputfilter_protect_email($output, &$smarty) { return preg_replace('!(\S+)@([a-zA-Z0-9\.\-]+\.([a-zA-Z]{2,3}|[0-9]{1,3}))!', '$1%40$2', $output); @@ -3344,24 +3344,24 @@ echo 'index.tpl compiled at 2002-02-20 20:02'; bool smarty_resource_name_source string $rsrc_name - string &$source - object &$smarty + string &$source + object &$smarty bool smarty_resource_name_timestamp string $rsrc_name - int &$timestamp - object &$smarty + int &$timestamp + object &$smarty bool smarty_resource_name_secure string $rsrc_name - object &$smarty + object &$smarty bool smarty_resource_name_trusted string $rsrc_name - object &$smarty + object &$smarty @@ -3417,7 +3417,7 @@ echo 'index.tpl compiled at 2002-02-20 20:02'; * Purpose: Fetches templates from a database * ------------------------------------------------------------- */ -function smarty_resource_db_source($tpl_name, &$tpl_source, &$smarty) +function smarty_resource_db_source($tpl_name, &$tpl_source, &$smarty) { // do database call here to fetch your template, // populating $tpl_source @@ -3433,7 +3433,7 @@ function smarty_resource_db_source($tpl_name, &$tpl_source, &$smarty) } } -function smarty_resource_db_timestamp($tpl_name, &$tpl_timestamp, &$smarty) +function smarty_resource_db_timestamp($tpl_name, &$tpl_timestamp, &$smarty) { // do database call here to populate $tpl_timestamp. $sql = new SQL; @@ -3448,13 +3448,13 @@ function smarty_resource_db_timestamp($tpl_name, &$tpl_timestamp, &$smarty) } } -function smarty_resource_db_secure($tpl_name, &$smarty) +function smarty_resource_db_secure($tpl_name, &$smarty) { // assume all templates are secure return true; } -function smarty_resource_db_trusted($tpl_name, &$smarty) +function smarty_resource_db_trusted($tpl_name, &$smarty) { // not used for templates } @@ -3474,7 +3474,7 @@ function smarty_resource_db_trusted($tpl_name, &$smarty) string smarty_insert_name array $params - object &$smarty + object &$smarty @@ -3500,7 +3500,7 @@ function smarty_resource_db_trusted($tpl_name, &$smarty) * Purpose: Inserts current date/time according to format * ------------------------------------------------------------- */ -function smarty_insert_time($params, &$smarty) +function smarty_insert_time($params, &$smarty) { if (empty($params['format'])) { $smarty->trigger_error("insert time: missing 'format' parameter"); @@ -3537,4 +3537,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 +-->