diff --git a/docs/en/programmers/advanced-features.xml b/docs/en/programmers/advanced-features.xml index 238b7e77..f130cf82 100644 --- a/docs/en/programmers/advanced-features.xml +++ b/docs/en/programmers/advanced-features.xml @@ -55,7 +55,7 @@ // the object class My_Object { - function meth1($params, &$smarty_obj) { + function meth1($params, &$smarty_obj) { return "this is my meth1"; } } @@ -110,7 +110,7 @@ the output was {$output} /U","",$tpl_source); } @@ -147,7 +147,7 @@ $smarty->display("index.tpl"); ;\n\" ?>;\n".$tpl_source; } @@ -191,7 +191,7 @@ $smarty->display("index.tpl"); display("file:F:/path/to/my/templates/menu.tpl"); display("db:index.tpl"); is_cached("index.tpl")) $db_data = array( "City" => "Lincoln", "State" => "Nebraska", - "Zip" = > "68502" + "Zip" => "68502" ); $smarty->assign("Name","Fred"); @@ -511,7 +511,7 @@ if(!$smarty->is_cached("index.tpl")) $db_data = array( "City" => "Lincoln", "State" => "Nebraska", - "Zip" = > "68502" + "Zip" => "68502" ); $smarty->assign("Name","Fred"); @@ -577,10 +577,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 } } @@ -735,7 +735,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 @@ -1228,4 +1228,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/caching.xml b/docs/en/programmers/caching.xml index 300d0ea4..6040d44d 100644 --- a/docs/en/programmers/caching.xml +++ b/docs/en/programmers/caching.xml @@ -359,7 +359,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)"; @@ -400,7 +400,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); @@ -448,4 +448,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/plugins.xml b/docs/en/programmers/plugins.xml index 4e69859b..77d3bf94 100644 --- a/docs/en/programmers/plugins.xml +++ b/docs/en/programmers/plugins.xml @@ -182,7 +182,7 @@ require_once $smarty->_get_plugin_filepath('function', 'html_options'); * Purpose: outputs a random magic answer * ------------------------------------------------------------- */ -function smarty_function_eightball($params, &$smarty) +function smarty_function_eightball($params, &$smarty) { $answers = array('Yes', 'No', @@ -221,7 +221,7 @@ Answer: {eightball}. * Purpose: assign a value to a template variable * ------------------------------------------------------------- */ -function smarty_function_assign($params, &$smarty) +function smarty_function_assign($params, &$smarty) { if (empty($params['var'])) { $smarty->trigger_error("assign: missing 'var' parameter"); @@ -415,7 +415,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']; @@ -470,7 +470,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'). "';"; } @@ -547,7 +547,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); } @@ -570,7 +570,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; @@ -614,7 +614,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); @@ -716,7 +716,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 @@ -732,7 +732,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; @@ -747,13 +747,13 @@ function smarty_resource_db_timestamp($tpl_name, &$tpl_timestamp, &$smar } } -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 } @@ -799,7 +799,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");