diff --git a/docs/en/designers/chapter-debugging-console.xml b/docs/en/designers/chapter-debugging-console.xml index 78178b5e..9b5b5e5c 100644 --- a/docs/en/designers/chapter-debugging-console.xml +++ b/docs/en/designers/chapter-debugging-console.xml @@ -4,16 +4,24 @@ Debugging Console There is a debugging console included with Smarty. The console informs you - of all the included templates, assigned variables and config file variables + of all the + included templates, + assigned variables and + config + file variables for the current invocation of the template. A template named "debug.tpl" is included with the distribution of Smarty which controls the formatting of - the console. Set $debugging to true in Smarty, and if needed set $debug_tpl - to the template resource path for debug.tpl (this is in SMARTY_DIR by + the console. Set + $debugging to true in Smarty, and if needed set + $debug_tpl + to the template resource path for debug.tpl (this is in + SMARTY_DIR by default.) When you load the page, a javascript console window should pop up and give you the names of all the included templates and assigned variables for the current page. To see the available variables for a particular templates, see the {debug} - template function. To disable the debugging console, set $debugging to + template function. To disable the debugging console, set + $debugging to false. You can also temporarily turn on the debugging console by putting SMARTY_DEBUG in the URL if you enable this option with $debugging_ctrl. @@ -21,8 +29,11 @@ Technical Note - The debugging console does not work when you use the fetch() - API, only when using display(). It is a set of javascript statements added + The debugging console does not work when you use the + fetch() + API, only when using + display(). + It is a set of javascript statements added to the very bottom of the generated template. If you do not like javascript, you can edit the debug.tpl template to format the output however you like. Debug data is not cached and debug.tpl info is not included in the output of @@ -57,3 +68,5 @@ vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> + + diff --git a/docs/en/designers/config-files.xml b/docs/en/designers/config-files.xml index 70ea7cc1..c67c3a4b 100644 --- a/docs/en/designers/config-files.xml +++ b/docs/en/designers/config-files.xml @@ -40,7 +40,9 @@ pass=foobar - Values of config file variables can be in quotes, but not necessary. + Values of + config file variables + can be in quotes, but not necessary. You can use either single or double quotes. If you have a value that spans more than one line, enclose the entire value with triple quotes ("""). You can put comments into config files by any syntax that is not @@ -56,11 +58,16 @@ pass=foobar section is loaded, then the global variables and the variables from that section are also loaded. If a variable exists both as a global and in a section, the section variable is used. If you name two variables the - same within a section, the last one will be used. + same within a section, the last one will be used. (see + $config_overwrite) Config files are loaded into templates with the built-in function - config_load. + {config_load} + , and + config_load(). You can hide variables or entire sections by prepending the variable diff --git a/docs/en/designers/language-basic-syntax/language-escaping.xml b/docs/en/designers/language-basic-syntax/language-escaping.xml index ec40a473..0c5a75c3 100644 --- a/docs/en/designers/language-basic-syntax/language-escaping.xml +++ b/docs/en/designers/language-basic-syntax/language-escaping.xml @@ -20,8 +20,7 @@ Similar to HTML entity usage, you can use {ldelim},{rdelim} or {$smarty.ldelim},{$smarty.rdelim} + linkend="language.variables.smarty.ldelim">{$smarty.ldelim} to display the current delimiters. @@ -60,6 +59,9 @@ dosomething(); ]]> + + See also escape modifier + + diff --git a/docs/en/getting-started.xml b/docs/en/getting-started.xml index 8d9956d2..f682056a 100644 --- a/docs/en/getting-started.xml +++ b/docs/en/getting-started.xml @@ -85,42 +85,53 @@ - Configurable template delimiter tag syntax, so you can use + Configurable template + delimiter tag + syntax, so you can use {}, {{}}, <!--{}-->, etc. - The if/elseif/else/endif constructs are passed to the + The if/elseif/else/endif + constructs are passed to the PHP parser, so the {if ...} expression syntax can be as simple or as complex as you like. - Unlimited nesting of sections, ifs, etc. allowed. + Unlimited nesting of + sections, + ifs, etc. allowed. - It is possible to embed PHP code right in your template files, although + It is possible to + embed PHP code + right in your template files, although this may not be needed (nor recommended) since the engine is so customizable. - Built-in caching support + Built-in caching support - Arbitrary template sources + Arbitrary template sources - Custom cache handling functions + Custom cache handling + functions @@ -241,9 +252,16 @@ $smarty = new Smarty; templates_c, configs and cache. Each of these are definable by the - Smarty class properties $template_dir, - $compile_dir, $config_dir, and - $cache_dir respectively. It is highly recommended + Smarty class properties + + $template_dir, + + $compile_dir, + + $config_dir, and + + $cache_dir respectively. + It is highly recommended that you setup a separate set of these directories for each application that will use Smarty. @@ -310,8 +328,12 @@ $smarty = new Smarty; - Smarty will need write access to the $compile_dir and - $cache_dir, so be sure the web server user can write + Smarty will need write access to the + + $compile_dir and + + $cache_dir, + so be sure the web server user can write to them. This is usually user "nobody" and group "nobody". For OS X users, the default is user "www" and group "www". If you are using Apache, you can look in your httpd.conf file (usually in "/usr/local/apache/conf/") to see diff --git a/docs/en/language-snippets.ent b/docs/en/language-snippets.ent index 92c0b3ca..1f573d71 100644 --- a/docs/en/language-snippets.ent +++ b/docs/en/language-snippets.ent @@ -5,7 +5,8 @@ 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 + or result in non-sequential keys. This is unlike the + array_merge() function of PHP which wipes out numerical keys and renumbers them. '> @@ -15,10 +16,13 @@ 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 + 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 + also set the $compile_id variable once instead of passing this to each call to this function. '> diff --git a/docs/en/programmers/advanced-features/advanced-features-objects.xml b/docs/en/programmers/advanced-features/advanced-features-objects.xml index f6d5d98d..162709db 100644 --- a/docs/en/programmers/advanced-features/advanced-features-objects.xml +++ b/docs/en/programmers/advanced-features/advanced-features-objects.xml @@ -4,18 +4,22 @@ Objects Smarty allows access to PHP objects through the templates. There are - two ways to access them. One way is to register objects to the template, + two ways to access them. One way is to + register objects to the template, then use access them via syntax similar to custom functions. The other way - is to assign objects to the templates and access them much like any other + is to assign objects + to the templates and access them much like any other assigned variable. The first method has a much nicer template syntax. It is also more secure, as a registered object can be restricted to certain - methods or properties. However, a registered object cannot be looped over - or assigned in arrays of objects, etc. The method you choose will be + methods or properties. However, + a registered object cannot be looped over + or assigned in arrays of objects, etc. The method you choose will be determined by your needs, but use the first method whenever possible to keep template syntax to a minimum. - If security is enabled, no private methods or functions can be accessed + If security is enabled, + no private methods or functions can be accessed (begininning with "_"). If a method and property of the same name exist, the method will be used. @@ -25,7 +29,9 @@ By default, parameters passed to objects through the templates are passed - the same way custom functions get them. An associative array is passed + the same way + custom functions get them. + An associative array is passed as the first parameter, and the smarty object as the second. If you want the parameters passed one at a time for each argument like traditional object parameter passing, set the fourth registration parameter to false. diff --git a/docs/en/programmers/advanced-features/template-resources.xml b/docs/en/programmers/advanced-features/template-resources.xml index d8fb831a..9371ceb0 100644 --- a/docs/en/programmers/advanced-features/template-resources.xml +++ b/docs/en/programmers/advanced-features/template-resources.xml @@ -3,7 +3,9 @@ Resources - The templates may come from a variety of sources. When you display or fetch + The templates may come from a variety of sources. When you + display() or + fetch() a template, or when you include a template from within another template, you supply a resource type, followed by the appropriate path and template name. If a resource is not explicitly given the value of Templates from $template_dir - Templates from the $template_dir do not require a template + Templates from the + $template_dir do not require a template resource, although you can use the file: resource for consistancy. - Just supply the path to the template you want to use relative to - the $template_dir root directory. + Just supply the path to the template you want to use relative to the + $template_dir + root directory. using templates from $template_dir @@ -38,7 +42,9 @@ $smarty->display("file:admin/menu.tpl"); // same as one above Templates from any directory - Templates outside of the $template_dir require the file: template + Templates outside of the + $template_dir + require the file: template resource type, followed by the absolute path and name of the template. @@ -200,7 +206,8 @@ $smarty->display("db:index.tpl"); + 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 b86e17e3..520394a0 100644 --- a/docs/en/programmers/api-functions/api-append-by-ref.xml +++ b/docs/en/programmers/api-functions/api-append-by-ref.xml @@ -14,9 +14,11 @@ boolmerge - This is used to append values to the templates by reference. + 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, + 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, @@ -29,12 +31,17 @@ append_by_ref("Name", $myname); -$smarty->append_by_ref("Address", $address); +$smarty->append_by_ref('Name', $myname); +$smarty->append_by_ref('Address', $address); ?> ]]> + + See also append() and + assign(). + + + diff --git a/docs/en/programmers/api-functions/api-assign.xml b/docs/en/programmers/api-functions/api-assign.xml index cc7d7e51..90d84635 100644 --- a/docs/en/programmers/api-functions/api-assign.xml +++ b/docs/en/programmers/api-functions/api-assign.xml @@ -31,11 +31,19 @@ $smarty->assign('Name', 'Fred'); $smarty->assign('Address', $address); // passing an associative array -$smarty->assign(array("city" => "Lincoln", "state" => "Nebraska")); +$smarty->assign(array('city' => 'Lincoln', 'state' => 'Nebraska')); ?> ]]> + + See also assign_by_ref(), + clear_assign(), + append(), + {assign}. + and + get_template_vars() + + 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 cb6c33ed..a42febe1 100644 --- a/docs/en/programmers/api-functions/api-clear-all-cache.xml +++ b/docs/en/programmers/api-functions/api-clear-all-cache.xml @@ -27,6 +27,12 @@ $smarty->clear_all_cache(); ]]> + + See also + clear_cache() + and + caching +