From 4b80984d6a7441fc3fdb454f56ff39b104eae9c0 Mon Sep 17 00:00:00 2001 From: nlopess Date: Sat, 21 May 2005 12:41:15 +0000 Subject: [PATCH] another patch by Peter. some WS. --- docs/en/appendixes/tips.xml | 37 +++- .../language-syntax-functions.xml | 21 ++- .../language-syntax-quotes.xml | 5 +- .../language-syntax-variables.xml | 11 +- .../language-function-capture.xml | 22 ++- .../language-function-include-php.xml | 9 +- .../language-function-insert.xml | 17 +- .../language-function-section.xml | 18 +- .../language-combining-modifiers.xml | 4 +- .../language-modifier-count-characters.xml | 15 +- .../language-modifier-count-paragraphs.xml | 13 +- .../language-modifier-count-sentences.xml | 15 +- .../language-modifier-count-words.xml | 16 +- .../language-modifier-date-format.xml | 11 +- .../language-modifier-default.xml | 11 +- .../language-modifier-escape.xml | 3 +- .../language-modifier-indent.xml | 9 +- .../language-modifier-nl2br.xml | 14 +- .../language-modifier-regex-replace.xml | 12 +- .../language-modifier-replace.xml | 12 +- .../language-modifier-spacify.xml | 13 +- .../language-modifier-string-format.xml | 11 +- .../language-modifier-wordwrap.xml | 12 +- .../language-assigned-variables.xml | 164 +++++++++--------- 24 files changed, 289 insertions(+), 186 deletions(-) diff --git a/docs/en/appendixes/tips.xml b/docs/en/appendixes/tips.xml index a6942e55..5afa8863 100644 --- a/docs/en/appendixes/tips.xml +++ b/docs/en/appendixes/tips.xml @@ -9,7 +9,8 @@ There may be times when you want to print a default value for an empty variable instead of printing nothing, such as printing "&nbsp;" so that - table backgrounds work properly. Many would use an {if} statement to + table backgrounds work properly. Many would use an + {if} statement to handle this, but there is a shorthand way with Smarty, using the default variable modifier. @@ -32,7 +33,10 @@ ]]> - See also default and Default Variable Handling + + See also default + and Default Variable Handling. + @@ -55,8 +59,12 @@ ]]> - See also default and Blank Variable Handling + + See also default and + Blank Variable Handling. + + Passing variable title to header template @@ -125,7 +133,8 @@ footer.tpl As of Smarty 1.4.0, you can pass dates to Smarty as unix - timestamps, mysql timestamps, or any date parsable by strtotime(). + timestamps, mysql timestamps, or any date parsable by + strtotime(). @@ -165,7 +174,8 @@ Jan 4, 2001 - When using {html_select_date} in a template, The programmer will most + When using {html_select_date} + in a template, The programmer will most likely want to convert the output from the form back into timestamp format. Here is a function to help you with that. @@ -269,7 +279,8 @@ function insert_header($params) Traditionally, programming templates into your applications goes as follows: First, you accumulate your variables within your PHP application, (maybe with database queries.) Then, you instantiate your - Smarty object, assign the variables and display the template. So lets + Smarty object, assign the variables and + display the template. So lets say for example we have a stock ticker on our template. We would collect the stock data in our application, then assign these variables in the template and display it. Now wouldn't it be nice if you could @@ -317,8 +328,13 @@ Stock Name: {$ticker.name} Stock Price: {$ticker.price} ]]> - See also {include_php}, {include} and {php} + + See also {include_php}, + {include} and + {php}. + + Obfuscating E-mail Addresses @@ -346,9 +362,12 @@ Send inquiries to e-mail collector to decode these values, but not likely. - See also escape + + See also escape. + - + + \ No newline at end of file +--> diff --git a/docs/en/designers/language-modifiers/language-modifier-count-paragraphs.xml b/docs/en/designers/language-modifiers/language-modifier-count-paragraphs.xml index 8c3a095a..8d5c7d35 100644 --- a/docs/en/designers/language-modifiers/language-modifier-count-paragraphs.xml +++ b/docs/en/designers/language-modifiers/language-modifier-count-paragraphs.xml @@ -38,12 +38,13 @@ Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation. ]]> - See also count_characters, - count_sentences and - count_words - - - + + See also count_characters, + count_sentences and + count_words. + + + \ No newline at end of file +--> diff --git a/docs/en/designers/language-modifiers/language-modifier-count-words.xml b/docs/en/designers/language-modifiers/language-modifier-count-words.xml index 402f6153..cd1adf35 100644 --- a/docs/en/designers/language-modifiers/language-modifier-count-words.xml +++ b/docs/en/designers/language-modifiers/language-modifier-count-words.xml @@ -37,13 +37,13 @@ Dealers Will Hear Car Talk at Noon. ]]> - See also count_characters, - count_paragraphs and - count_sentences - - - - + + See also count_characters, + count_paragraphs and + count_sentences. + + + \ No newline at end of file +--> diff --git a/docs/en/designers/language-modifiers/language-modifier-date-format.xml b/docs/en/designers/language-modifiers/language-modifier-date-format.xml index 1cdffffa..81833ed7 100644 --- a/docs/en/designers/language-modifiers/language-modifier-date-format.xml +++ b/docs/en/designers/language-modifiers/language-modifier-date-format.xml @@ -211,8 +211,13 @@ Monday, February 5, 2001 - See also $smarty.now, {html_select_date} and date tips - + + See also $smarty.now, + {html_select_date} + and date tips. + + + \ No newline at end of file +--> diff --git a/docs/en/designers/language-modifiers/language-modifier-default.xml b/docs/en/designers/language-modifiers/language-modifier-default.xml index a5bebf6c..b723b673 100644 --- a/docs/en/designers/language-modifiers/language-modifier-default.xml +++ b/docs/en/designers/language-modifiers/language-modifier-default.xml @@ -67,9 +67,12 @@ no title ]]> - See also Default Variable Handling and Blank Variable Handling - - + + See also Default Variable Handling + and Blank Variable Handling. + + + \ No newline at end of file +--> diff --git a/docs/en/designers/language-modifiers/language-modifier-escape.xml b/docs/en/designers/language-modifiers/language-modifier-escape.xml index 1f6dd868..29a21e9d 100644 --- a/docs/en/designers/language-modifiers/language-modifier-escape.xml +++ b/docs/en/designers/language-modifiers/language-modifier-escape.xml @@ -81,7 +81,8 @@ $smarty->display('index.tpl'); - See also Escaping Smarty Parsing and Obfuscating E-mail Addresses. + See also Escaping Smarty Parsing + and Obfuscating E-mail Addresses. diff --git a/docs/en/designers/language-modifiers/language-modifier-indent.xml b/docs/en/designers/language-modifiers/language-modifier-indent.xml index 80fd818f..a1bb8a0a 100644 --- a/docs/en/designers/language-modifiers/language-modifier-indent.xml +++ b/docs/en/designers/language-modifiers/language-modifier-indent.xml @@ -95,7 +95,12 @@ Statistics show that teen pregnancy drops off significantly after 25. ]]> - + + See also strip + and spacify. + + + \ No newline at end of file +--> diff --git a/docs/en/designers/language-modifiers/language-modifier-nl2br.xml b/docs/en/designers/language-modifiers/language-modifier-nl2br.xml index 442e2d4c..b64bdd75 100644 --- a/docs/en/designers/language-modifiers/language-modifier-nl2br.xml +++ b/docs/en/designers/language-modifiers/language-modifier-nl2br.xml @@ -4,7 +4,8 @@ nl2br All linebreaks will be converted to <br /> tags in the given - variable. This is equivalent to the PHP nl2br() function. + variable. This is equivalent to the PHP + nl2br() function. nl2br @@ -36,8 +37,13 @@ Sun or rain expected
today, dark tonight ]]>
-See also word_wrap, count_paragraphs and count_sentences - + + See also word_wrap, + count_paragraphs + and count_sentences. + + + \ No newline at end of file +--> diff --git a/docs/en/designers/language-modifiers/language-modifier-regex-replace.xml b/docs/en/designers/language-modifiers/language-modifier-regex-replace.xml index 621d1600..f6a45563 100644 --- a/docs/en/designers/language-modifiers/language-modifier-regex-replace.xml +++ b/docs/en/designers/language-modifiers/language-modifier-regex-replace.xml @@ -38,7 +38,8 @@ A regular expression search and replace on a variable. Use the - syntax for preg_replace() from the PHP manual. + syntax for preg_replace() from the PHP manual. regex_replace @@ -75,7 +76,12 @@ Infertility unlikely to be passed on, experts say. ]]> - + + See also replace + and escape. + + + \ No newline at end of file +--> diff --git a/docs/en/designers/language-modifiers/language-modifier-replace.xml b/docs/en/designers/language-modifiers/language-modifier-replace.xml index 4f7e84f8..d578c828 100644 --- a/docs/en/designers/language-modifiers/language-modifier-replace.xml +++ b/docs/en/designers/language-modifiers/language-modifier-replace.xml @@ -37,7 +37,8 @@ - A simple search and replace on a variable. + A simple search and replace on a variable. This is equivalent to the PHP + str_replace() function. replace @@ -73,7 +74,12 @@ Child's Stool Great for Use in Garden. ]]> - + + See also regex_replace + and escape. + + + \ No newline at end of file +--> diff --git a/docs/en/designers/language-modifiers/language-modifier-spacify.xml b/docs/en/designers/language-modifiers/language-modifier-spacify.xml index 66e5fe10..e5db4ec1 100644 --- a/docs/en/designers/language-modifiers/language-modifier-spacify.xml +++ b/docs/en/designers/language-modifiers/language-modifier-spacify.xml @@ -61,12 +61,17 @@ $smarty->display('index.tpl'); - + + See also wordwrap + and nl2br. + + + \ No newline at end of file +--> diff --git a/docs/en/designers/language-modifiers/language-modifier-string-format.xml b/docs/en/designers/language-modifiers/language-modifier-string-format.xml index e5724be0..4944337e 100644 --- a/docs/en/designers/language-modifiers/language-modifier-string-format.xml +++ b/docs/en/designers/language-modifiers/language-modifier-string-format.xml @@ -31,7 +31,8 @@ This is a way to format strings, such as decimal numbers and such. - Use the syntax for sprintf for the formatting. + Use the syntax for sprintf + for the formatting. string_format @@ -67,7 +68,11 @@ $smarty->display('index.tpl'); ]]> - + + See also date_format. + + + \ No newline at end of file +--> diff --git a/docs/en/designers/language-modifiers/language-modifier-wordwrap.xml b/docs/en/designers/language-modifiers/language-modifier-wordwrap.xml index d7bc908a..71b7dff3 100644 --- a/docs/en/designers/language-modifiers/language-modifier-wordwrap.xml +++ b/docs/en/designers/language-modifiers/language-modifier-wordwrap.xml @@ -51,7 +51,8 @@ to wrap the text to the next line (default is carriage return \n). By default, wordwrap will attempt to wrap at a word boundary. If you want to cut off at the exact character length, pass the optional - third parameter of true. + third parameter of true. This is equivalent to the PHP wordwrap() function. wordwrap @@ -108,8 +109,11 @@ years. ]]> -See also nl2br - + + See also nl2br. + + + \ No newline at end of file +--> diff --git a/docs/en/designers/language-variables/language-assigned-variables.xml b/docs/en/designers/language-variables/language-assigned-variables.xml index 04989e1d..1a30397d 100644 --- a/docs/en/designers/language-variables/language-assigned-variables.xml +++ b/docs/en/designers/language-variables/language-assigned-variables.xml @@ -1,45 +1,43 @@ - - Variables assigned from PHP - - Variables that are assigned from PHP are referenced by preceding them with - a dollar sign $. Variables assigned from within the - template with the assign - function are also displayed this way. - - - - assigned variables - + + Variables assigned from PHP + + Variables that are assigned from PHP are referenced by preceding them with + a dollar sign $. Variables assigned from within the + template with the assign + function are also displayed this way. + + + assigned variables + Your last login was on {$lastLoginDate}. ]]> - - - This will output: - - + + + This will output: + + Your last login was on January 11th, 2001. ]]> - - - - - Associative arrays - - You can also reference associative array variables that are - assigned from PHP by specifying the key after the '.' (period) - symbol. - - - accessing associative array variables - + + + + Associative arrays + + You can also reference associative array variables that are + assigned from PHP by specifying the key after the '.' (period) + symbol. + + + accessing associative array variables + assign('Contacts', $smarty->display('index.tpl'); ?> ]]> - - - where the content of index.tpl is: - - + + + where the content of index.tpl is: + + {$Contacts.email}
@@ -63,29 +61,29 @@ $smarty->display('index.tpl'); {$Contacts.phone.home}
{$Contacts.phone.cell}
]]> -
- - this will output: - - + + + this will output: + + zaphod@slartibartfast.com
555-444-3333
555-111-1234
]]> -
-
-
- - Array indexes - - You can reference arrays by their index, much like native PHP - syntax. - - + + + + + Array indexes + + You can reference arrays by their index, much like native PHP + syntax. + + accessing arrays by index - + display('index.tpl'); ?> ]]> - - - where index.tpl is: - - + + + where index.tpl is: + + {$Contacts[1]}
@@ -111,46 +109,48 @@ $smarty->display('index.tpl'); {$Contacts[2][0]}
{$Contacts[2][1]}
]]> -
- - This will output: - - +
+ + This will output: + + zaphod@slartibartfast.com
555-444-3333
555-111-1234
]]> -
-
-
- - Objects - - Properties of objects assigned from PHP can be referenced - by specifying the property name after the '->' symbol. - - - accessing object properties - + + + + + Objects + + Properties of objects + assigned from PHP can be referenced by specifying the property + name after the '->' symbol. + + + accessing object properties + name}
email: {$person->email}
]]> -
- - this will output: - - + + + this will output: + + email: zaphod@slartibartfast.com
]]> -
-
-
+ + +
+ \ No newline at end of file +-->