cvs: smarty /docs/en/designers language-builtin-functions.xml language-modifiers.xml /docs/en/designers/language-custom-functions
language-function-html-options.xml /docs/en/designers/language-modifiers language-modifier-capitalize.xml language-modifier-cat.xml
language-modifier-count-characters.xml language-modifier-count-paragraphs.xml language-modifier-count-sentences.xml language-modifier-count-words.xml
language-modifier-date-format.xml language-modifier-default.xml language-modifier-escape.xml language-modifier-indent.xml language-modifier-lower.xml
language-modifier-nl2br.xml language-modifier-regex-replace.xml language-modifier-replace.xml language-modifier-spacify.xml
language-modifier-string-format.xml language-modifier-strip-tags.xml language-modifier-strip.xml language-modifier-truncate.xml
language-modifier-upper.xml language-modifier-wordwrap.xml

From: Date: Tue, 26 Sep 2006 19:28:45 +0000
Subject: cvs: smarty /docs/en/designers language-builtin-functions.xml language-modifiers.xml /docs/en/designers/language-custom-functions
language-function-html-options.xml /docs/en/designers/language-modifiers language-modifier-capitalize.xml language-modifier-cat.xml
language-modifier-count-characters.xml language-modifier-count-paragraphs.xml language-modifier-count-sentences.xml language-modifier-count-words.xml
language-modifier-date-format.xml language-modifier-default.xml language-modifier-escape.xml language-modifier-indent.xml language-modifier-lower.xml
language-modifier-nl2br.xml language-modifier-regex-replace.xml language-modifier-replace.xml language-modifier-spacify.xml
language-modifier-string-format.xml language-modifier-strip-tags.xml language-modifier-strip.xml language-modifier-truncate.xml
language-modifier-upper.xml language-modifier-wordwrap.xml
Groups: php.smarty.cvs 
Request: Send a blank email to php-smarty-cvs+get-2111@lists.php.net to get a copy of this message
pete_morgan Tue Sep 26 19:28:45 2006 UTC Modified files: /smarty/docs/en/designers language-builtin-functions.xml language-modifiers.xml /smarty/docs/en/designers/language-custom-functions language-function-html-options.xml /smarty/docs/en/designers/language-modifiers language-modifier-capitalize.xml language-modifier-cat.xml language-modifier-count-characters.xml language-modifier-count-paragraphs.xml language-modifier-count-sentences.xml language-modifier-count-words.xml language-modifier-date-format.xml language-modifier-default.xml language-modifier-escape.xml language-modifier-indent.xml language-modifier-lower.xml language-modifier-nl2br.xml language-modifier-regex-replace.xml language-modifier-replace.xml language-modifier-spacify.xml language-modifier-string-format.xml language-modifier-strip-tags.xml language-modifier-strip.xml language-modifier-truncate.xml language-modifier-upper.xml language-modifier-wordwrap.xml Log: Tidying up some markup

http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-builtin-functions.xml?r1=1.6&r2=1.7&diff_format=u Index: smarty/docs/en/designers/language-builtin-functions.xml diff -u smarty/docs/en/designers/language-builtin-functions.xml:1.6 smarty/docs/en/designers/language-builtin-functions.xml:1.7 --- smarty/docs/en/designers/language-builtin-functions.xml:1.6 Tue Mar 28 01:02:25 2006 +++ smarty/docs/en/designers/language-builtin-functions.xml Tue Sep 26 19:28:45 2006 @@ -1,22 +1,22 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <chapter id="language.builtin.functions"> <title>Built-in Functions</title> <para> - Smarty comes with several built-in functions. These built-in functions + Smarty comes with several built-in functions. These built-in functions are the integral part of the smarty template engine. You cannot create your own <link linkend="language.custom.functions">custom functions</link> - with the same name; and you should not need to + with the same name; and you should not need to modify the built-in functions. </para> <para> - A few on these functions have an <emphasis role="bold">assign</emphasis> - attribute which collects - the result the function to a named variable within a template instead of being output; - much like the <link linkend="language.function.assign">{assign}</link> function. + A few on these functions have an <parameter>assign</parameter> + attribute which collects the result the function to a named + variable within a template instead of being output; + much like the <link linkend="language.function.assign"> + <varname>{assign}</varname></link> function. </para> - &designers.language-builtin-functions.language-function-capture; &designers.language-builtin-functions.language-function-config-load; &designers.language-builtin-functions.language-function-foreach; @@ -29,7 +29,7 @@ &designers.language-builtin-functions.language-function-php; &designers.language-builtin-functions.language-function-section; &designers.language-builtin-functions.language-function-strip; - + </chapter> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers.xml?r1=1.23&r2=1.24&diff_format=u Index: smarty/docs/en/designers/language-modifiers.xml diff -u smarty/docs/en/designers/language-modifiers.xml:1.23 smarty/docs/en/designers/language-modifiers.xml:1.24 --- smarty/docs/en/designers/language-modifiers.xml:1.23 Mon Mar 27 23:57:08 2006 +++ smarty/docs/en/designers/language-modifiers.xml Tue Sep 26 19:28:45 2006 @@ -1,19 +1,22 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.23 $ --> +<!-- $Revision: 1.24 $ --> <chapter id="language.modifiers"> <title>Variable Modifiers</title> <para> - Variable modifiers can be applied to - <link linkend="language.syntax.variables">variables</link>, - <link linkend="language.custom.functions">custom functions</link> or strings. To - apply a modifier, specify the value followed by a <literal>|</literal> + Variable modifiers can be applied to + <link linkend="language.syntax.variables">variables</link>, + <link linkend="language.custom.functions">custom functions</link> or strings. + To apply a modifier, specify the value followed by a <literal>|</literal> (pipe) and the modifier name. A modifier may accept additional parameters that affect its behavior. These parameters follow the modifer name and are - separated by a <literal>:</literal> (colon). Additionally - all php-functions can be used as modifiers implicitly; more below. + separated by a <literal>:</literal> (colon). Also, + <emphasis>all php-functions can be used as modifiers implicitly</emphasis> + (more below) and modifiers can be + <link linkend="language.combining.modifiers">combined</link>. + . </para> <example> - <title>modifier examples</title> + <title>Modifier examples</title> <programlisting> <![CDATA[ {* apply modifier to a variable *} @@ -53,43 +56,61 @@ ]]> </programlisting> </example> - <para> + <itemizedlist> + + <listitem><para> If you apply a modifier to an array variable instead of a single value variable, the modifier will be applied to every value in that array. If you really want the modifier to work on an entire array as a value, you must prepend the - modifier name with an <literal>@</literal> symbol like so: - <literal>{$articleTitle|@count}</literal> (this will print out the number of - elements in the $articleTitle array.) - </para> - <para> + modifier name with a <literal>@</literal> symbol. + <note> + <title>Example</title> + <para><literal>{$articleTitle|@count}</literal> - will print out the number of + elements in the <parameter>$articleTitle</parameter> array using the php + <ulink url="&url.php-manual;count"><varname>count()</varname></ulink> + function as a modifier. + </para></note> + </para> </listitem> + + <listitem><para> Modifiers are autoloaded from the <link - linkend="variable.plugins.dir">$plugins_dir</link> - or can be registered explicitely with <link - linkend="api.register.modifier">register_modifier()</link>; - this is useful for sharing a function in a php script and smarty templates. - </para> - - <para> - All php-functions can be used as modifiers implicitly. (The - <literal>@count</literal> example above actually uses php's - count() function and not a smarty-modifier). Using php-functions - as modifiers has two little pitfalls: First; sometimes the order - of the function-parameters is not the desirable one - (<literal>{"%2.f"|sprintf:$float}</literal> actually works, but - asks for the more intuitive. For example:<literal>{$float|string_format:"%2.f"}</literal> - that is provided by the Smarty distribution). Second; with <link - linkend="variable.security">$security</link> enabled all - php-functions that are to be used as modifiers have to be - declared trusted in the <link linkend="variable.security.settings"> - $security_settings['MODIFIER_FUNCS']</link> array. - </para> + linkend="variable.plugins.dir"><parameter>$plugins_dir</parameter></link> + or can be registered explicitely with the <link + linkend="api.register.modifier"><varname>register_modifier()</varname></link> + function. The later is useful for sharing a function between + php scripts and smarty templates. + </para></listitem> + + <listitem><para> + All php-functions can be used as modifiers implicitly, as demonstrated in the + example above. + However, using php-functions as modifiers has two little pitfalls: + <itemizedlist> + <listitem><para>First - sometimes the order of the function-parameters is + not the desirable one. Formatting <literal>$foo</literal> with + <literal>{"%2.f"|sprintf:$foo}</literal> actually + works, but asks for the more intuitive, like + <literal>{$foo|string_format:"%2.f"}</literal> that is provided by + the Smarty distribution. + </para></listitem> + <listitem><para> + Secondly - if <link linkend="variable.security"> + <parameter>$security</parameter></link> is enabled, all php-functions that + are to be used as modifiers have to be declared trusted in the + <literal>MODIFIER_FUNCS</literal> element of the + <link linkend="variable.security.settings"> + <parameter>$security_settings</parameter></link> array. + </para></listitem> + </itemizedlist> + </para></listitem> + </itemizedlist> + <para> See also - <link linkend="api.register.modifier">register_modifier()</link>, - <link linkend="api.register.function">register_function()</link>, - <link linkend="plugins">extending Smarty with plugins</link> + <link linkend="api.register.modifier"><varname>register_modifier()</varname></link>, + <link linkend="language.combining.modifiers">combining modifiers</link>. and - <link linkend="plugins.modifiers">modifiers</link>, + <link linkend="plugins">extending smarty with plugins</link> </para> &designers.language-modifiers.language-modifier-capitalize; @@ -113,7 +134,7 @@ &designers.language-modifiers.language-modifier-truncate; &designers.language-modifiers.language-modifier-upper; &designers.language-modifiers.language-modifier-wordwrap; - + </chapter> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-custom-functions/language-function-html-options.xml?r1=1.15&r2=1.16&diff_format=u Index: smarty/docs/en/designers/language-custom-functions/language-function-html-options.xml diff -u smarty/docs/en/designers/language-custom-functions/language-function-html-options.xml:1.15 smarty/docs/en/designers/language-custom-functions/language-function-html-options.xml:1.16 --- smarty/docs/en/designers/language-custom-functions/language-function-html-options.xml:1.15 Tue Sep 26 02:02:55 2006 +++ smarty/docs/en/designers/language-custom-functions/language-function-html-options.xml Tue Sep 26 19:28:45 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.15 $ --> +<!-- $Revision: 1.16 $ --> <sect1 id="language.function.html.options"> <title>{html_options}</title> <para> @@ -194,13 +194,13 @@ ]]> </programlisting> <para> -where an example template would be +Where a template could be as follows. Note the use of the truncate modifier. </para> <programlisting> <![CDATA[ <select name="type_id"> <option value='null'>-- none --</option> - {html_options options=$contact_types selected=$contact.type_id} + {html_options options=$contact_types|truncate:20 selected=$contact.type_id} </select> ]]> </programlisting> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-capitalize.xml?r1=1.6&r2=1.7&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-capitalize.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-capitalize.xml:1.6 smarty/docs/en/designers/language-modifiers/language-modifier-capitalize.xml:1.7 --- smarty/docs/en/designers/language-modifiers/language-modifier-capitalize.xml:1.6 Tue Sep 13 17:53:50 2005 +++ smarty/docs/en/designers/language-modifiers/language-modifier-capitalize.xml Tue Sep 26 19:28:45 2006 @@ -1,9 +1,11 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <sect1 id="language.modifier.capitalize"> <title>capitalize</title> <para> This is used to capitalize the first letter of all words in a variable. + This is similar to the PHP <ulink url="&url.php-manual;ucfirst"> + <varname>ucfirst()</varname></ulink> function. </para> <informaltable frame="all"> <tgroup cols="5"> @@ -26,13 +28,13 @@ <entry>1</entry> <entry>boolean</entry> <entry>No</entry> - <entry>false</entry> + <entry>&false;</entry> <entry>This determines whether or not words with digits will be uppercased</entry> </row> </tbody> </tgroup> - </informaltable> + </informaltable> <example> <title>capitalize</title> <programlisting role="php"> @@ -45,7 +47,7 @@ ]]> </programlisting> <para> - Where template is: + Where the template is: </para> <programlisting> <![CDATA[ @@ -55,7 +57,7 @@ ]]> </programlisting> <para> - This will output: + Will output: </para> <screen> <![CDATA[ @@ -65,9 +67,11 @@ ]]> </screen> </example> - <para>See also <link linkend="language.modifier.lower">lower</link> + <para>See also + <link linkend="language.modifier.lower"><varname>lower</varname></link> and - <link linkend="language.modifier.upper">upper</link> </para> + <link linkend="language.modifier.upper"><varname>upper</varname></link> + </para> </sect1> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-cat.xml?r1=1.3&r2=1.4&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-cat.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-cat.xml:1.3 smarty/docs/en/designers/language-modifiers/language-modifier-cat.xml:1.4 --- smarty/docs/en/designers/language-modifiers/language-modifier-cat.xml:1.3 Tue Sep 13 17:53:50 2005 +++ smarty/docs/en/designers/language-modifiers/language-modifier-cat.xml Tue Sep 26 19:28:45 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <sect1 id="language.modifier.cat"> <title>cat</title> <para> @@ -37,7 +37,7 @@ <title>cat</title> <programlisting role="php"> <![CDATA[ -<?php +<?php $smarty->assign('articleTitle', "Psychics predict world didn't end"); @@ -49,14 +49,14 @@ </para> <programlisting> <![CDATA[ -{$articleTitle|cat:" yesterday."} +{$articleTitle|cat:' yesterday.'} ]]> </programlisting> <para> - This will output: + Will output: </para> <screen> -<![CDATA[ +<![CDATA[ Psychics predict world didn't end yesterday. ]]> </screen> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-count-characters.xml?r1=1.6&r2=1.7&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-count-characters.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-count-characters.xml:1.6 smarty/docs/en/designers/language-modifiers/language-modifier-count-characters.xml:1.7 --- smarty/docs/en/designers/language-modifiers/language-modifier-count-characters.xml:1.6 Tue Sep 13 17:53:50 2005 +++ smarty/docs/en/designers/language-modifiers/language-modifier-count-characters.xml Tue Sep 26 19:28:45 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <sect1 id="language.modifier.count.characters"> <title>count_characters</title> <para> @@ -26,7 +26,7 @@ <entry>1</entry> <entry>boolean</entry> <entry>No</entry> - <entry>false</entry> + <entry>&false;</entry> <entry>This determines whether or not to include whitespace characters in the count.</entry> </row> @@ -56,7 +56,7 @@ ]]> </programlisting> <para> - This will output: + Will output: </para> <screen> <![CDATA[ @@ -68,9 +68,9 @@ </example> <para> See also - <link linkend="language.modifier.count.words">count_words</link>, - <link linkend="language.modifier.count.sentences">count_sentences</link> and - <link linkend="language.modifier.count.paragraphs">count_paragraphs</link>. + <link linkend="language.modifier.count.words"><varname>count_words</varname></link>, + <link linkend="language.modifier.count.sentences"><varname>count_sentences</varname></link> and + <link linkend="language.modifier.count.paragraphs"><varname>count_paragraphs</varname></link>. </para> </sect1> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-count-paragraphs.xml?r1=1.5&r2=1.6&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-count-paragraphs.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-count-paragraphs.xml:1.5 smarty/docs/en/designers/language-modifiers/language-modifier-count-paragraphs.xml:1.6 --- smarty/docs/en/designers/language-modifiers/language-modifier-count-paragraphs.xml:1.5 Wed May 25 19:13:20 2005 +++ smarty/docs/en/designers/language-modifiers/language-modifier-count-paragraphs.xml Tue Sep 26 19:28:45 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <sect1 id="language.modifier.count.paragraphs"> <title>count_paragraphs</title> <para> @@ -29,21 +29,23 @@ ]]> </programlisting> <para> - This will output: + Will output: </para> <screen> <![CDATA[ War Dims Hope for Peace. Child's Death Ruins Couple's Holiday. - + Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation. 2 ]]> </screen> </example> <para> - See also <link linkend="language.modifier.count.characters">count_characters</link>, - <link linkend="language.modifier.count.sentences">count_sentences</link> and - <link linkend="language.modifier.count.words">count_words</link>. + See also + <link linkend="language.modifier.count.characters"><varname>count_characters</varname></link>, + <link linkend="language.modifier.count.sentences"><varname>count_sentences</varname></link> + and + <link linkend="language.modifier.count.words"><varname>count_words</varname></link>. </para> </sect1> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-count-sentences.xml?r1=1.5&r2=1.6&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-count-sentences.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-count-sentences.xml:1.5 smarty/docs/en/designers/language-modifiers/language-modifier-count-sentences.xml:1.6 --- smarty/docs/en/designers/language-modifiers/language-modifier-count-sentences.xml:1.5 Wed May 25 19:13:20 2005 +++ smarty/docs/en/designers/language-modifiers/language-modifier-count-sentences.xml Tue Sep 26 19:28:45 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <sect1 id="language.modifier.count.sentences"> <title>count_sentences</title> <para> @@ -10,7 +10,7 @@ <programlisting role="php"> <![CDATA[ <?php - + $smarty->assign('articleTitle', 'Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.' @@ -29,7 +29,7 @@ ]]> </programlisting> <para> - This will output: + Will output: </para> <screen> <![CDATA[ @@ -39,9 +39,11 @@ </screen> </example> <para> - See also <link linkend="language.modifier.count.characters">count_characters</link>, - <link linkend="language.modifier.count.paragraphs">count_paragraphs</link> and - <link linkend="language.modifier.count.words">count_words</link>. + See also + <link linkend="language.modifier.count.characters"><varname>count_characters</varname></link>, + <link linkend="language.modifier.count.paragraphs"><varname>count_paragraphs</varname></link> + and + <link linkend="language.modifier.count.words"><varname>count_words</varname></link>. </para> </sect1> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-count-words.xml?r1=1.5&r2=1.6&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-count-words.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-count-words.xml:1.5 smarty/docs/en/designers/language-modifiers/language-modifier-count-words.xml:1.6 --- smarty/docs/en/designers/language-modifiers/language-modifier-count-words.xml:1.5 Wed May 25 19:13:20 2005 +++ smarty/docs/en/designers/language-modifiers/language-modifier-count-words.xml Tue Sep 26 19:28:45 2006 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <sect1 id="language.modifier.count.words"> <title>count_words</title> <para> @@ -10,7 +10,7 @@ <programlisting role="php"> <![CDATA[ <?php - + $smarty->assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.'); ?> @@ -36,10 +36,12 @@ </screen> </example> <para> - See also <link linkend="language.modifier.count.characters">count_characters</link>, - <link linkend="language.modifier.count.paragraphs">count_paragraphs</link> and - <link linkend="language.modifier.count.sentences">count_sentences</link>. - </para> + See also + <link linkend="language.modifier.count.characters"><varname>count_characters</varname></link>, + <link linkend="language.modifier.count.paragraphs"><varname>count_paragraphs</varname></link> + and + <link linkend="language.modifier.count.sentences"><varname>count_sentences</varname></link>. + </para> </sect1> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml?r1=1.13&r2=1.14&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml:1.13 smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml:1.14 --- smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml:1.13 Tue Mar 7 19:15:37 2006 +++ smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml Tue Sep 26 19:28:45 2006 @@ -1,20 +1,21 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.13 $ --> +<!-- $Revision: 1.14 $ --> <sect1 id="language.modifier.date.format"> <title>date_format</title> <para> This formats a date and time into the given - <ulink url="&url.php-manual;strftime">strftime()</ulink> format. + <ulink url="&url.php-manual;strftime"><varname>strftime()</varname></ulink> format. Dates can be passed to Smarty as unix <ulink url="&url.php-manual;function.time">timestamps</ulink>, mysql timestamps - or any string made up of month day year, parsable by - <ulink url="&url.php-manual;strtotime">strtotime()</ulink>. - Designers can then use date_format to have complete control of the + or any string made up of month day year, parsable by php's + <ulink url="&url.php-manual;strtotime"><varname>strtotime()</varname></ulink>. + Designers can then use <varname>date_format</varname> to have complete control of the formatting of the date. If the date passed to - <command>date_format</command> is empty and a second parameter is passed, + <varname>date_format</varname> is empty and a second parameter is passed, that will be used as the date to format. </para> - + + <informaltable frame="all"> <tgroup cols="5"> <colspec colname="param" align="center" /> @@ -53,20 +54,32 @@ <para> <note> <para> - Since Smarty-2.6.10 numeric values passed to date_format are + Since Smarty-2.6.10 numeric values passed to <varname>date_format</varname> are <emphasis>always</emphasis> (except for mysql timestamps, see below) interpreted as a unix timestamp. </para> <para> Before Smarty-2.6.10 numeric strings that where also parsable by - strtotime() in php (like "YYYYMMDD") where sometimes - depending - on the underlying implementation of strtotime() - interpreted as - date strings and not as timestamps. + <varname>strtotime()</varname> in php (like <literal>YYYYMMDD</literal>) + where sometimes (depending on the underlying implementation of + <varname>strtotime()</varname>) interpreted as + date strings and NOT as timestamps. </para> <para> The only exception are mysql timestamps: They are also numeric - only and 14 characters long ("YYYYMMDDHHMMSS"). Mysql timestamps - have precedence over unix timestamps. + only and 14 characters long (<literal>YYYYMMDDHHMMSS</literal>), + mysql timestamps have precedence over unix timestamps. + </para> + </note> + <note> + <title>Programmers note</title> + <para> + <varname>date_format</varname> is essentially a wrapper to PHP's + <ulink url="&url.php-manual;strftime"><varname>strftime()</varname></ulink> function. + You may have more or less conversion specifiers available depending + on your system's <ulink url="&url.php-manual;strftime"><varname>strftime()</varname></ulink> + function where PHP was compiled. Check your + system's manpage for a full list of valid specifiers. </para> </note> </para> @@ -78,14 +91,15 @@ $config['date'] = '%I:%M %p'; $config['time'] = '%H:%M:%S'; -$smarty->assign('config',$config); +$smarty->assign('config', $config); $smarty->assign('yesterday', strtotime('-1 day')); ?> ]]> </programlisting> <para> - Where template is (uses <link linkend="language.variables.smarty.now">$smarty.now</link>): + This template uses <link linkend="language.variables.smarty.now"> + <parameter>$smarty.now</parameter></link> to get the current time: </para> <programlisting> <![CDATA[ @@ -98,21 +112,22 @@ ]]> </programlisting> <para> - This will output: + This above will output: </para> <screen> <![CDATA[ -Feb 6, 2001 -02/06/01 +Jan 1, 2022 +01/01/22 02:33 pm -Feb 5, 2001 -Monday, February 5, 2001 +Dec 31, 2021 +Monday, December 1, 2021 14:33:00 ]]> </screen> </example> <para> - <command>date_format</command> conversion specifiers: + + <command>date_format</command> conversion specifiers: <itemizedlist> <listitem><para> %a - abbreviated weekday name according to the current locale @@ -237,23 +252,13 @@ %% - a literal `%' character </para></listitem> </itemizedlist> - <note> - <title>Programmers note</title> - <para> - <command>date_format</command> is essentially a wrapper to PHP's - <ulink url="&url.php-manual;strftime">strftime()</ulink> function. - You may have more or less conversion specifiers available depending - on your system's <ulink url="&url.php-manual;strftime">strftime()</ulink> - function where PHP was compiled. Check your - system's manpage for a full list of valid specifiers. - </para> - </note> + </para> <para> - See also <link linkend="language.variables.smarty.now">$smarty.now</link>, - <ulink url="&url.php-manual;strftime">php function strftime()</ulink>, - <link linkend="language.function.html.select.date">{html_select_date}</link> - and <link linkend="tips.dates">date tips</link>. + See also <link linkend="language.variables.smarty.now"><parameter>$smarty.now</parameter></link>, + <ulink url="&url.php-manual;strftime"><varname>strftime()</varname></ulink>, + <link linkend="language.function.html.select.date"><varname>{html_select_date}</varname></link> + and the <link linkend="tips.dates">date tips</link> page. </para> </sect1> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-default.xml?r1=1.8&r2=1.9&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-default.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-default.xml:1.8 smarty/docs/en/designers/language-modifiers/language-modifier-default.xml:1.9 --- smarty/docs/en/designers/language-modifiers/language-modifier-default.xml:1.8 Thu Apr 6 13:23:40 2006 +++ smarty/docs/en/designers/language-modifiers/language-modifier-default.xml Tue Sep 26 19:28:45 2006 @@ -1,21 +1,23 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.8 $ --> +<!-- $Revision: 1.9 $ --> <sect1 id="language.modifier.default"> <title>default</title> <para> This is used to set a default value for a variable. If the variable is unset or an empty string, the given default value is printed instead. - Default takes one argument. + Default takes the one argument. </para> <para> <note> <para> - With error_reporting(E_ALL), undeclared variables will always throw an error within the template. This function - is useful for replacing null or zero length strings. + With <ulink url="&url.php-manual;error_reporting"> + <varname>error_reporting(E_ALL)</varname></ulink>, + undeclared variables will always throw an error within the template. + This function is useful for replacing null or zero length strings. </para> </note> </para> - + <informaltable frame="all"> <tgroup cols="5"> <colspec colname="param" align="center" /> @@ -52,7 +54,7 @@ <?php $smarty->assign('articleTitle', 'Dealers Will Hear Car Talk at Noon.'); -$smarty->assign('email',''); +$smarty->assign('email', ''); ?> ]]> @@ -68,7 +70,7 @@ ]]> </programlisting> <para> - This will output: + Will output: </para> <screen> <![CDATA[ @@ -79,8 +81,10 @@ </screen> </example> <para> - See also <link linkend="tips.default.var.handling">Default Variable Handling</link> - and <link linkend="tips.blank.var.handling">Blank Variable Handling</link>. + See also the + <link linkend="tips.default.var.handling">default variable handling</link> + and the + <link linkend="tips.blank.var.handling">blank variable handling</link> pages. </para> </sect1> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml?r1=1.15&r2=1.16&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml:1.15 smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml:1.16 --- smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml:1.15 Mon May 15 13:10:32 2006 +++ smarty/docs/en/designers/language-modifiers/language-modifier-escape.xml Tue Sep 26 19:28:45 2006 @@ -1,13 +1,15 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.15 $ --> +<!-- $Revision: 1.16 $ --> <sect1 id="language.modifier.escape"> <title>escape</title> <para> - This is used to encode/escape a variable to html url single quotes, hex escape, hexentity, javascript and mail escape. - By default its html - escaped. + This is used to encode/escape a variable to <literal>html</literal>, + <literal>url</literal>, <literal>single quotes</literal>, + <literal>hex</literal>, <literal>hexentity</literal>, + <literal>javascript</literal> and <literal>mail</literal>. + By default its <literal>html</literal> escaped. </para> - + <informaltable frame="all"> <tgroup cols="6"> <colspec colname="param" align="center" /> @@ -31,7 +33,12 @@ <entry>1</entry> <entry>string</entry> <entry>No</entry> - <entry><literal>html</literal>,<literal>htmlall</literal>,<literal>url</literal>,<literal>urlpathinfo</literal>,<literal>quotes</literal>,<literal>hex</literal>,<literal>hexentity</literal>,<literal>javascript</literal>,<literal>mail</literal></entry> + <entry><literal>html</literal>, <literal>htmlall</literal>, + <literal>url</literal>, + <literal>urlpathinfo</literal>, <literal>quotes</literal>, + <literal>hex</literal>, <literal>hexentity</literal>, + <literal>javascript</literal>, <literal>mail</literal> + </entry> <entry><literal>html</literal></entry> <entry>This is the escape format to use.</entry> </row> @@ -39,8 +46,11 @@ <entry>2</entry> <entry>string</entry> <entry>No</entry> - <entry><literal>ISO-8859-1</literal>, <literal>UTF-8</literal>, ... any character set supported by <ulink url="&url.php-manual;htmlentities">htmlentities()</ulink> -</entry> + <entry><literal>ISO-8859-1</literal>, <literal>UTF-8</literal>, + and any character set supported by + <ulink url="&url.php-manual;htmlentities"> + <varname>htmlentities()</varname></ulink> + </entry> <entry><literal>ISO-8859-1</literal></entry> <entry>The character set encoding passed to htmlentities() et. al.</entry> </row> @@ -53,11 +63,12 @@ <programlisting role="php"> <![CDATA[ <?php - + $smarty->assign('articleTitle', "'Stiff Opposition Expected to Casketless Funeral Plan'" ); $smarty->assign('EmailAddress','smarty@example.com'); + ?> ]]> </programlisting> @@ -78,7 +89,7 @@ ]]> </programlisting> <para> - This will output: + Will output: </para> <screen> <![CDATA[ @@ -93,29 +104,37 @@ mail [AT] example [DOT] com ]]> </screen> - <para>Note that native PHP functions can be used as modifiers so this will work</para> + </example> + + <example> + <title>Other examples</title> + <para>PHP functions can be used as modifiers, + <link linkend="variable.security"> + <varname>$security</varname></link> permitting. + </para> <screen> <![CDATA[ -{* rewind get var registers the current location *} +{* the "rewind" paramater registers the current location *} <a href="{$SCRIPT_NAME}?page=foo&rewind={$smarty.server.REQUEST_URI|urlencode}">click here</a> ]]> </screen> - <para>And this is very useful for emails but see also - <link linkend="language.function.mailto">{mailto}</link></para> + <para>This snippet is useful for emails, but see also + <link linkend="language.function.mailto"> + <varname>{mailto}</varname></link></para> <screen> <![CDATA[ {* email address mangled *} <a href="mailto:{$EmailAddress|escape:'hex'}">{$EmailAddress|escape:'mail'}</a> ]]> - </screen> + </screen> </example> - - - + <para> - See also <link linkend="language.escaping">Escaping Smarty Parsing</link>, - <link linkend="language.function.mailto">{mailto}</link> - and <link linkend="tips.obfuscating.email">Obfuscating E-mail Addresses</link>. + See also + <link linkend="language.escaping">escaping smarty parsing</link>, + <link linkend="language.function.mailto"><varname>{mailto}</varname></link> + and the + <link linkend="tips.obfuscating.email">obfuscating email addresses</link> page. </para> </sect1> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-indent.xml?r1=1.6&r2=1.7&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-indent.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-indent.xml:1.6 smarty/docs/en/designers/language-modifiers/language-modifier-indent.xml:1.7 --- smarty/docs/en/designers/language-modifiers/language-modifier-indent.xml:1.6 Tue Mar 7 19:22:49 2006 +++ smarty/docs/en/designers/language-modifiers/language-modifier-indent.xml Tue Sep 26 19:28:45 2006 @@ -1,14 +1,14 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <sect1 id="language.modifier.indent"> <title>indent</title> <para> - This indents a string at each line, default is 4. As + This indents a string on each line, default is 4. As an optional parameter, you can specify the number of characters to indent. As an optional second parameter, you can specify the - character to use to indent with. (Use "\t" for tabs.) + character to use to indent with eg use <literal>"\t"</literal> for a tab. </para> - + <informaltable frame="all"> <tgroup cols="5"> <colspec colname="param" align="center" /> @@ -50,14 +50,12 @@ <programlisting role="php"> <![CDATA[ <?php - + $smarty->assign('articleTitle', 'NJ judge to rule on nude beach. Sun or rain expected today, dark tonight. Statistics show that teen pregnancy drops off significantly after 25.' ); - - ?> ]]> </programlisting> @@ -76,7 +74,7 @@ ]]> </programlisting> <para> - this will output: + Will output: </para> <screen> <![CDATA[ @@ -99,9 +97,11 @@ </screen> </example> <para> - See also <link linkend="language.modifier.strip">strip</link>, - <link linkend="language.modifier.wordwrap">wordwrap</link> - and <link linkend="language.modifier.spacify">spacify</link>. + See also + <link linkend="language.modifier.strip"><varname>strip</varname></link>, + <link linkend="language.modifier.wordwrap"><varname>wordwrap</varname></link> + and + <link linkend="language.modifier.spacify"><varname>spacify</varname></link>. </para> </sect1> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-lower.xml?r1=1.5&r2=1.6&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-lower.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-lower.xml:1.5 smarty/docs/en/designers/language-modifiers/language-modifier-lower.xml:1.6 --- smarty/docs/en/designers/language-modifiers/language-modifier-lower.xml:1.5 Thu Mar 16 05:04:42 2006 +++ smarty/docs/en/designers/language-modifiers/language-modifier-lower.xml Tue Sep 26 19:28:45 2006 @@ -1,26 +1,27 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <sect1 id="language.modifier.lower"> <title>lower</title> <para> This is used to lowercase a variable. This is equivalent to the PHP - <ulink url="&url.php-manual;strtolower">strtolower()</ulink> function. + <ulink url="&url.php-manual;strtolower"> + <varname>strtolower()</varname></ulink> function. </para> <example> <title>lower</title> <programlisting role="php"> <![CDATA[ <?php - + $smarty->assign('articleTitle', 'Two Convicts Evade Noose, Jury Hung.'); - + ?> ]]> </programlisting> <para> Where template is: </para> - <programlisting> + <programlisting> <![CDATA[ {$articleTitle} {$articleTitle|lower} @@ -37,8 +38,10 @@ </screen> </example> <para> - See also <link linkend="language.modifier.upper">upper</link> and - <link linkend="language.modifier.capitalize">Capitalize</link>. + See also + <link linkend="language.modifier.upper"><varname>upper</varname></link> + and + <link linkend="language.modifier.capitalize"><varname>capitalize</varname></link>. </para> </sect1> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-nl2br.xml?r1=1.5&r2=1.6&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-nl2br.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-nl2br.xml:1.5 smarty/docs/en/designers/language-modifiers/language-modifier-nl2br.xml:1.6 --- smarty/docs/en/designers/language-modifiers/language-modifier-nl2br.xml:1.5 Tue Mar 28 01:39:27 2006 +++ smarty/docs/en/designers/language-modifiers/language-modifier-nl2br.xml Tue Sep 26 19:28:45 2006 @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <sect1 id="language.modifier.nl2br"> <title>nl2br</title> <para> - All linebreaks will be converted to &lt;br /&gt; tags in the given - variable. This is equivalent to the PHP - <ulink url="&url.php-manual;nl2br">nl2br()</ulink> function. + All <literal>"\n"</literal> line breaks will be converted to html + <literal>&lt;br /&gt;</literal> tags in the given variable. + This is equivalent to the PHP's <ulink url="&url.php-manual;nl2br"> + <varname>nl2br()</varname></ulink> function. </para> <example> <title>nl2br</title> @@ -29,7 +30,7 @@ ]]> </programlisting> <para> - will output: + Will output: </para> <screen> <![CDATA[ @@ -38,9 +39,11 @@ </screen> </example> <para> - See also <link linkend="language.modifier.wordwrap">word_wrap</link>, - <link linkend="language.modifier.count.paragraphs">count_paragraphs</link> - and <link linkend="language.modifier.count.sentences">count_sentences</link>. + See also + <link linkend="language.modifier.wordwrap"><varname>word_wrap</varname></link>, + <link linkend="language.modifier.count.paragraphs"><varname>count_paragraphs</varname></link> + and + <link linkend="language.modifier.count.sentences"><varname>count_sentences</varname></link>. </para> </sect1> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-regex-replace.xml?r1=1.4&r2=1.5&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-regex-replace.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-regex-replace.xml:1.4 smarty/docs/en/designers/language-modifiers/language-modifier-regex-replace.xml:1.5 --- smarty/docs/en/designers/language-modifiers/language-modifier-regex-replace.xml:1.4 Tue Sep 13 17:53:50 2005 +++ smarty/docs/en/designers/language-modifiers/language-modifier-regex-replace.xml Tue Sep 26 19:28:45 2006 @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <sect1 id="language.modifier.regex.replace"> <title>regex_replace</title> <para> A regular expression search and replace on a variable. Use the - syntax for <ulink - url="&url.php-manual;preg_replace">preg_replace()</ulink> from the PHP manual. + <ulink url="&url.php-manual;preg_replace"> + <varname>preg_replace()</varname></ulink> syntax from the PHP manual. </para> - + <informaltable frame="all"> <tgroup cols="5"> <colspec colname="param" align="center" /> @@ -55,7 +55,7 @@ ]]> </programlisting> <para> - Where index.tpl is: + Where template is: </para> <programlisting> <![CDATA[ @@ -66,7 +66,7 @@ ]]> </programlisting> <para> - This should output: + Will output: </para> <screen> <![CDATA[ @@ -77,8 +77,10 @@ </screen> </example> <para> - See also <link linkend="language.modifier.replace">replace</link> - and <link linkend="language.modifier.escape">escape</link>. + See also <link linkend="language.modifier.replace"> + <varname>replace</varname></link> + and + <link linkend="language.modifier.escape"><varname>escape</varname></link>. </para> </sect1> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-replace.xml?r1=1.5&r2=1.6&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-replace.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-replace.xml:1.5 smarty/docs/en/designers/language-modifiers/language-modifier-replace.xml:1.6 --- smarty/docs/en/designers/language-modifiers/language-modifier-replace.xml:1.5 Tue Sep 13 17:53:50 2005 +++ smarty/docs/en/designers/language-modifiers/language-modifier-replace.xml Tue Sep 26 19:28:45 2006 @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <sect1 id="language.modifier.replace"> <title>replace</title> <para> - A simple search and replace on a variable. This is equivalent to the PHP - <ulink url="&url.php-manual;str_replace">str_replace()</ulink> function. + A simple search and replace on a variable. This is equivalent to the PHP's + <ulink url="&url.php-manual;str_replace"> + <varname>str_replace()</varname></ulink> function. </para> - + <informaltable frame="all"> <tgroup cols="5"> <colspec colname="param" align="center" /> @@ -64,7 +65,7 @@ ]]> </programlisting> <para> - This should output: + Will output: </para> <screen> <![CDATA[ @@ -75,8 +76,10 @@ </screen> </example> <para> - See also <link linkend="language.modifier.regex.replace">regex_replace</link> - and <link linkend="language.modifier.escape">escape</link>. + See also + <link linkend="language.modifier.regex.replace"><varname>regex_replace</varname></link> + and + <link linkend="language.modifier.escape"><varname>escape</varname></link>. </para> </sect1> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-spacify.xml?r1=1.4&r2=1.5&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-spacify.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-spacify.xml:1.4 smarty/docs/en/designers/language-modifiers/language-modifier-spacify.xml:1.5 --- smarty/docs/en/designers/language-modifiers/language-modifier-spacify.xml:1.4 Tue Sep 13 17:53:50 2005 +++ smarty/docs/en/designers/language-modifiers/language-modifier-spacify.xml Tue Sep 26 19:28:45 2006 @@ -1,10 +1,11 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <sect1 id="language.modifier.spacify"> <title>spacify</title> <para> - spacify is a way to insert a space between every character of a variable. - You can optionally pass a different character (or string) to insert. + <varname>spacify</varname> is a way to insert a space between every + character of a variable. + You can optionally pass a different character or string to insert. </para> <informaltable frame="all"> <tgroup cols="5"> @@ -57,7 +58,7 @@ ]]> </programlisting> <para> - This should output: + Will output: </para> <screen> <![CDATA[ @@ -68,8 +69,10 @@ </screen> </example> <para> - See also <link linkend="language.modifier.wordwrap">wordwrap</link> - and <link linkend="language.modifier.nl2br">nl2br</link>. + See also + <link linkend="language.modifier.wordwrap"><varname>wordwrap</varname></link> + and + <link linkend="language.modifier.nl2br"><varname>nl2br</varname></link>. </para> </sect1> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-string-format.xml?r1=1.5&r2=1.6&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-string-format.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-string-format.xml:1.5 smarty/docs/en/designers/language-modifiers/language-modifier-string-format.xml:1.6 --- smarty/docs/en/designers/language-modifiers/language-modifier-string-format.xml:1.5 Tue Sep 13 17:53:50 2005 +++ smarty/docs/en/designers/language-modifiers/language-modifier-string-format.xml Tue Sep 26 19:28:45 2006 @@ -1,13 +1,14 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <sect1 id="language.modifier.string.format"> <title>string_format</title> <para> This is a way to format strings, such as decimal numbers and such. - Use the syntax for <ulink url="&url.php-manual;sprintf">sprintf()</ulink> + Use the syntax for + <ulink url="&url.php-manual;sprintf"><varname>sprintf()</varname></ulink> for the formatting. </para> - + <informaltable frame="all"> <tgroup cols="5"> <colspec colname="param" align="center" /> @@ -58,7 +59,7 @@ ]]> </programlisting> <para> - This should output: + Will output: </para> <screen> <![CDATA[ @@ -68,8 +69,10 @@ ]]> </screen> </example> + <para> - See also <link linkend="language.modifier.date.format">date_format</link>. + See also + <link linkend="language.modifier.date.format"><varname>date_format</varname></link>. </para> </sect1> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-strip-tags.xml?r1=1.4&r2=1.5&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-strip-tags.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-strip-tags.xml:1.4 smarty/docs/en/designers/language-modifiers/language-modifier-strip-tags.xml:1.5 --- smarty/docs/en/designers/language-modifiers/language-modifier-strip-tags.xml:1.4 Tue Sep 13 17:53:50 2005 +++ smarty/docs/en/designers/language-modifiers/language-modifier-strip-tags.xml Tue Sep 26 19:28:45 2006 @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <sect1 id="language.modifier.strip.tags"> <title>strip_tags</title> <para> - This strips out markup tags, basically anything between &lt; and &gt;. + This strips out markup tags, basically anything between + <literal>&lt;</literal> and <literal>&gt;</literal>. </para> - + <informaltable frame="all"> <tgroup cols="5"> <colspec colname="param" align="center" /> @@ -27,8 +28,8 @@ <entry>1</entry> <entry>bool</entry> <entry>No</entry> - <entry>true</entry> - <entry>This determines wether the tags are replaced by ' ' or by ''</entry> + <entry>&true;</entry> + <entry>This determines whether the tags are replaced by ' ' or ''</entry> </row> </tbody> </tgroup> @@ -49,17 +50,17 @@ ]]> </programlisting> <para> - where template is: + Where template is: </para> <programlisting> <![CDATA[ {$articleTitle} -{$articleTitle|strip_tags} {* same as {$articleTitle|strip_tags:true} *} +{$articleTitle|strip_tags} {* same as {$articleTitle|strip_tags:true} *} {$articleTitle|strip_tags:false} ]]> </programlisting> <para> - This will output: + Will output: </para> <screen> <![CDATA[ @@ -69,6 +70,12 @@ ]]> </screen> </example> + <para> + See also + <link linkend="language.modifier.replace"><varname>replace</varname></link> + and + <link linkend="language.modifier.regex.replace"><varname>regex_replace</varname></link>. + </para> </sect1> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-strip.xml?r1=1.4&r2=1.5&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-strip.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-strip.xml:1.4 smarty/docs/en/designers/language-modifiers/language-modifier-strip.xml:1.5 --- smarty/docs/en/designers/language-modifiers/language-modifier-strip.xml:1.4 Thu Mar 16 05:26:02 2006 +++ smarty/docs/en/designers/language-modifiers/language-modifier-strip.xml Tue Sep 26 19:28:45 2006 @@ -1,16 +1,16 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <sect1 id="language.modifier.strip"> <title>strip</title> <para> This replaces all repeated spaces, newlines and tabs with a single - space, or with a supplied string. + space, or with the supplied string. </para> <note> <title>Note</title> <para> - If you want to strip blocks of template text, use the <link - linkend="language.function.strip">{strip}</link> function. + If you want to strip blocks of template text, use the built-in <link + linkend="language.function.strip"><varname>{strip}</varname></link> function. </para> </note> <example> @@ -18,16 +18,13 @@ <programlisting role="php"> <![CDATA[ <?php - -$smarty = new Smarty; $smarty->assign('articleTitle', "Grandmother of\neight makes\t hole in one."); $smarty->display('index.tpl'); - ?> ]]> </programlisting> <para> - where template is: + Where template is: </para> <programlisting> <![CDATA[ @@ -37,7 +34,7 @@ ]]> </programlisting> <para> - This will output: + Will output: </para> <screen> <![CDATA[ @@ -48,10 +45,12 @@ ]]> </screen> </example> - + <para> - See also <link linkend="language.function.strip">{strip}</link> and - <link linkend="language.modifier.truncate">truncate</link>. + See also + <link linkend="language.function.strip"><varname>{strip}</varname></link> + and + <link linkend="language.modifier.truncate"><varname>truncate</varname></link>. </para> </sect1> <!-- Keep this comment at the end of the file http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-truncate.xml?r1=1.6&r2=1.7&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-truncate.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-truncate.xml:1.6 smarty/docs/en/designers/language-modifiers/language-modifier-truncate.xml:1.7 --- smarty/docs/en/designers/language-modifiers/language-modifier-truncate.xml:1.6 Tue Mar 28 00:59:38 2006 +++ smarty/docs/en/designers/language-modifiers/language-modifier-truncate.xml Tue Sep 26 19:28:45 2006 @@ -1,17 +1,17 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <sect1 id="language.modifier.truncate"> <title>truncate</title> <para> - This truncates a variable to a character length, default is 80. As - an optional second parameter, you can specify a string of text + This truncates a variable to a character length, the default is 80. + As an optional second parameter, you can specify a string of text to display at the end if the variable was truncated. The characters in the string are included with the original truncation length. - By default, truncate will attempt to cut off at a word boundary. If - you want to cut off at the exact character length, pass the optional - third parameter of true. + By default, <varname>truncate</varname> will attempt to cut off at a + word boundary. If you want to cut off at the exact character length, + pass the optional third parameter of &true;. </para> - + <informaltable frame="all"> <tgroup cols="5"> <colspec colname="param" align="center" /> @@ -49,18 +49,19 @@ <entry>3</entry> <entry>boolean</entry> <entry>No</entry> - <entry>false</entry> + <entry>&false;</entry> <entry>This determines whether or not to truncate at a - word boundary (false), or at the exact character (true).</entry> + word boundary with &false;, or at the exact character with &true;.</entry> </row> <row> <entry>4</entry> <entry>boolean</entry> <entry>No</entry> - <entry>false</entry> + <entry>&false;</entry> <entry>This determines whether the truncation happens at the end of the - string (false), or in the middle of the string (true). Note that if this - setting is true, then word boundaries are ignored.</entry> + string with &false;, or in the middle of the string with &true;. + Note that if this setting is &true;, then word boundaries are ignored. + </entry> </row> </tbody> </tgroup> @@ -71,9 +72,7 @@ <programlisting role="php"> <![CDATA[ <?php - $smarty->assign('articleTitle', 'Two Sisters Reunite after Eighteen Years at Checkout Counter.'); - ?> ]]> </programlisting> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-upper.xml?r1=1.4&r2=1.5&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-upper.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-upper.xml:1.4 smarty/docs/en/designers/language-modifiers/language-modifier-upper.xml:1.5 --- smarty/docs/en/designers/language-modifiers/language-modifier-upper.xml:1.4 Thu Mar 16 05:03:05 2006 +++ smarty/docs/en/designers/language-modifiers/language-modifier-upper.xml Tue Sep 26 19:28:45 2006 @@ -1,24 +1,23 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <sect1 id="language.modifier.upper"> <title>upper</title> <para> This is used to uppercase a variable. This is equivalent to the PHP - <ulink url="&url.php-manual;strtoupper">strtoupper()</ulink> function. + <ulink url="&url.php-manual;strtoupper"> + <varname>strtoupper()</varname></ulink> function. </para> <example> <title>upper</title> <programlisting role="php"> <![CDATA[ <?php - $smarty->assign('articleTitle', "If Strike isn't Settled Quickly it may Last a While."); - ?> ]]> </programlisting> <para> - where template is: + Where template is: </para> <programlisting> <![CDATA[ @@ -27,7 +26,7 @@ ]]> </programlisting> <para> - This will output: + Will output: </para> <screen> <![CDATA[ @@ -37,8 +36,10 @@ </screen> </example> <para> - See also <link linkend="language.modifier.lower">lower</link> and - <link linkend="language.modifier.capitalize">capitalize</link>. + See also + <link linkend="language.modifier.lower"><varname>lower</varname></link> + and + <link linkend="language.modifier.capitalize"><varname>capitalize</varname></link>. </para> </sect1> http://cvs.php.net/viewvc.cgi/smarty/docs/en/designers/language-modifiers/language-modifier-wordwrap.xml?r1=1.5&r2=1.6&diff_format=u Index: smarty/docs/en/designers/language-modifiers/language-modifier-wordwrap.xml diff -u smarty/docs/en/designers/language-modifiers/language-modifier-wordwrap.xml:1.5 smarty/docs/en/designers/language-modifiers/language-modifier-wordwrap.xml:1.6 --- smarty/docs/en/designers/language-modifiers/language-modifier-wordwrap.xml:1.5 Tue Sep 13 17:53:50 2005 +++ smarty/docs/en/designers/language-modifiers/language-modifier-wordwrap.xml Tue Sep 26 19:28:45 2006 @@ -1,17 +1,20 @@ <?xml version="1.0" encoding="iso-8859-1"?> -<!-- $Revision: 1.5 $ --> +<!-- $Revision: 1.6 $ --> <sect1 id="language.modifier.wordwrap"> <title>wordwrap</title> <para> - <command>wordwrap</command> wraps a string to a column width, default is 80. As - an optional second parameter, you can specify a string of text - 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. This is equivalent to the PHP <ulink - url="&url.php-manual;wordwrap">wordwrap()</ulink> function. + Wraps a string to a column width, + the default is 80. As an optional second parameter, + you can specify a string of text + to wrap the text to the next line, the default is a carriage return + <literal>"\n"</literal>. + By default, <varname>wordwrap</varname> will attempt to wrap at a word + boundary. If you want to cut off at the exact character length, pass + the optional third parameter as &true;. This is equivalent to the PHP + <ulink url="&url.php-manual;wordwrap"><varname>wordwrap()</varname></ulink> + function. </para> - + <informaltable frame="all"> <tgroup cols="5"> <colspec colname="param" align="center" /> @@ -48,9 +51,9 @@ <entry>3</entry> <entry>boolean</entry> <entry>No</entry> - <entry>false</entry> + <entry>&false;</entry> <entry>This determines whether or not to wrap at a - word boundary (false), or at the exact character (true).</entry> + word boundary (&false;), or at the exact character (&true;).</entry> </row> </tbody> </tgroup> @@ -61,7 +64,7 @@ <programlisting role="php"> <![CDATA[ <?php - + $smarty->assign('articleTitle', "Blind woman gets new kidney from dad she hasn't seen in years." ); @@ -70,23 +73,23 @@ ]]> </programlisting> <para> -where template is + Where template is </para> <programlisting> -<![CDATA[ +<![CDATA[ {$articleTitle} {$articleTitle|wordwrap:30} - + {$articleTitle|wordwrap:20} - + {$articleTitle|wordwrap:30:"<br />\n"} - + {$articleTitle|wordwrap:30:"\n":true} ]]> </programlisting> <para> - This will output: + Will output: </para> <screen> <![CDATA[ @@ -112,9 +115,10 @@ </screen> </example> <para> - See also <link linkend="language.modifier.nl2br">nl2br</link> + See also + <link linkend="language.modifier.nl2br"><varname>nl2br</varname></link> and - <link linkend="language.function.textformat">{textformat}</link>. + <link linkend="language.function.textformat"><varname>{textformat}</varname></link>. </para> </sect1>
« previous php.smarty.cvs (#2111) next »