commit Peter Morgan's patch to add more references/aka see also

some WS
This commit is contained in:
nlopess
2005-05-10 16:01:12 +00:00
parent 55dba92857
commit aeab0151bf
19 changed files with 300 additions and 277 deletions

View File

@@ -9,7 +9,7 @@
<para> <para>
There may be times when you want to print a default value for an empty There may be times when you want to print a default value for an empty
variable instead of printing nothing, such as printing "&amp;nbsp;" so that variable instead of printing nothing, such as printing "&amp;nbsp;" so that
table backgrounds work properly. Many would use an {if} statement to table backgrounds work properly. Many would use an <link linkend="language.function.if">{if}</link> statement to
handle this, but there is a shorthand way with Smarty, using the handle this, but there is a shorthand way with Smarty, using the
<emphasis>default</emphasis> variable modifier. <emphasis>default</emphasis> variable modifier.
</para> </para>
@@ -32,6 +32,7 @@
]]> ]]>
</programlisting> </programlisting>
</example> </example>
<para>See also <link linkend="language.modifier.default">default</link> and <link linkend="tips.default.var.handling">Default Variable Handling</link></para>
</sect1> </sect1>
<sect1 id="tips.default.var.handling"> <sect1 id="tips.default.var.handling">
@@ -54,6 +55,7 @@
]]> ]]>
</programlisting> </programlisting>
</example> </example>
<para>See also <link linkend="language.modifier.default">default</link> and <link linkend="tips.blank.var.handling">Blank Variable Handling</link></para>
</sect1> </sect1>
<sect1 id="tips.passing.vars"> <sect1 id="tips.passing.vars">
<title>Passing variable title to header template</title> <title>Passing variable title to header template</title>
@@ -123,7 +125,7 @@ footer.tpl
<note> <note>
<para> <para>
As of Smarty 1.4.0, you can pass dates to Smarty as unix 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 <ulink url="&url.php-manual;strtotime">strtotime()</ulink>.
</para> </para>
</note> </note>
<example> <example>
@@ -163,7 +165,7 @@ Jan 4, 2001
</programlisting> </programlisting>
</example> </example>
<para> <para>
When using {html_select_date} in a template, The programmer will most When using <link linkend="language.function.html.select.date">{html_select_date}</link> in a template, The programmer will most
likely want to convert the output from the form back into timestamp likely want to convert the output from the form back into timestamp
format. Here is a function to help you with that. format. Here is a function to help you with that.
</para> </para>
@@ -267,7 +269,7 @@ function insert_header($params)
Traditionally, programming templates into your applications goes as Traditionally, programming templates into your applications goes as
follows: First, you accumulate your variables within your PHP follows: First, you accumulate your variables within your PHP
application, (maybe with database queries.) Then, you instantiate your application, (maybe with database queries.) Then, you instantiate your
Smarty object, assign the variables and display the template. So lets Smarty object, <link linkend="api.assign">assign</link> the variables and <link linkend="api.display">display</link> the template. So lets
say for example we have a stock ticker on our template. We would say for example we have a stock ticker on our template. We would
collect the stock data in our application, then assign these variables 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 in the template and display it. Now wouldn't it be nice if you could
@@ -315,6 +317,7 @@ Stock Name: {$ticker.name} Stock Price: {$ticker.price}
]]> ]]>
</programlisting> </programlisting>
</example> </example>
<para>See also <link linkend="language.function.include.php">{include_php}</link>, <link linkend="language.function.include">{include}</link> and <link linkend="language.function.php">{php}</link></para>
</sect1> </sect1>
<sect1 id="tips.obfuscating.email"> <sect1 id="tips.obfuscating.email">
<title>Obfuscating E-mail Addresses</title> <title>Obfuscating E-mail Addresses</title>
@@ -343,6 +346,7 @@ Send inquiries to
e-mail collector to decode these values, but not likely. e-mail collector to decode these values, but not likely.
</para> </para>
</note> </note>
<para>See also <link linkend="language.modifier.escape">escape</link></para>
</sect1> </sect1>
</chapter> </chapter>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file

View File

@@ -28,6 +28,7 @@ PRACTICAL EXAMPLES:
]]> ]]>
</programlisting> </programlisting>
</example> </example>
<para>See also <link linkend="language.modifier.escape">escape</link></para>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -36,6 +36,8 @@ Many other combinations are allowed
]]> ]]>
</programlisting> </programlisting>
</example> </example>
<para>See also <link linkend="language.variables.smarty">$smarty reserved variables</link>
and <link linkend="language.config.variables">Config Variables</link></para>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -127,7 +127,7 @@
<para> <para>
See also <link linkend="config.files">Config Files</link> and See also <link linkend="config.files">Config Files</link> and
<link linkend="language.function.config.load">Config Load</link>. <link linkend="language.config.variables">Config variables</link>.
</para> </para>
</sect1> </sect1>

View File

@@ -54,8 +54,10 @@
</informaltable> </informaltable>
<para> <para>
<emphasis>foreach</emphasis> loops are an alternative to <emphasis>foreach</emphasis> loops are an alternative to
<emphasis>section</emphasis> loops. <emphasis>foreach</emphasis> is <link
used to loop over a single associative array. The syntax for linkend="language.function.section"><emphasis>section</emphasis></link>
loops. <emphasis>foreach</emphasis> is used to loop over a single
associative array. The syntax for
<emphasis>foreach</emphasis> is much easier than <emphasis>foreach</emphasis> is much easier than
<emphasis>section</emphasis>, but as a tradeoff it can only be used <emphasis>section</emphasis>, but as a tradeoff it can only be used
for a single array. <emphasis>foreach</emphasis> tags must be for a single array. <emphasis>foreach</emphasis> tags must be
@@ -178,6 +180,10 @@
<emphasis>total</emphasis> is used to display the number of iterations that this foreach <emphasis>total</emphasis> is used to display the number of iterations that this foreach
will loop. This can be used inside or after the foreach. will loop. This can be used inside or after the foreach.
</para> </para>
<para>
See also <link linkend="language.function.section">{section}</link> and
<link linkend="language.variables.smarty.loops">$smarty.foreach</link>.
</para>
</sect2> </sect2>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file

View File

@@ -84,7 +84,7 @@
<para> <para>
Use the syntax for <link Use the syntax for <link
linkend="template.resources">template resources</link> to linkend="template.resources">template resources</link> to
include files outside of the $template_dir directory. include files outside of the <link linkend="variable.template.dir">$template_dir</link> directory.
</para> </para>
<example> <example>
<title>function include template resource examples</title> <title>function include template resource examples</title>
@@ -101,6 +101,7 @@
{* include from template resource named "db" *} {* include from template resource named "db" *}
{include file="db:header.tpl"}</programlisting> {include file="db:header.tpl"}</programlisting>
</example> </example>
<para>See also <link linkend="language.function.include.php">{include_php}</link>, <link linkend="language.function.php">{php}</link> <link linkend="template.resources">Template Resources</link> and <link linkend="tips.componentized.templates">Componentized Templates</link></para>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -17,6 +17,7 @@
include("/path/to/display_weather.php"); include("/path/to/display_weather.php");
{/php}</programlisting> {/php}</programlisting>
</example> </example>
<para>See also <link linkend="language.function.include.php">{include_php}</link>, <link linkend="language.function.include">{include}</link> and <link linkend="tips.componentized.templates">Componentized Templates</link></para>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -30,8 +30,7 @@
<entry>time</entry> <entry>time</entry>
<entry>timestamp/YYYY-MM-DD</entry> <entry>timestamp/YYYY-MM-DD</entry>
<entry>No</entry> <entry>No</entry>
<entry>current time in unix timestamp or YYYY-MM-DD <entry>current time in unix timestamp or YYYY-MM-DD format</entry>
format</entry>
<entry>what date/time to use</entry> <entry>what date/time to use</entry>
</row> </row>
<row> <row>
@@ -143,32 +142,28 @@
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry>null</entry> <entry>null</entry>
<entry>adds extra attributes to all select/input tags if <entry>adds extra attributes to all select/input tags if given</entry>
given</entry>
</row> </row>
<row> <row>
<entry>day_extra</entry> <entry>day_extra</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry>null</entry> <entry>null</entry>
<entry>adds extra attributes to select/input tags if <entry>adds extra attributes to select/input tags if given</entry>
given</entry>
</row> </row>
<row> <row>
<entry>month_extra</entry> <entry>month_extra</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry>null</entry> <entry>null</entry>
<entry>adds extra attributes to select/input tags if <entry>adds extra attributes to select/input tags if given</entry>
given</entry>
</row> </row>
<row> <row>
<entry>year_extra</entry> <entry>year_extra</entry>
<entry>string</entry> <entry>string</entry>
<entry>No</entry> <entry>No</entry>
<entry>null</entry> <entry>null</entry>
<entry>adds extra attributes to select/input tags if <entry>adds extra attributes to select/input tags if given</entry>
given</entry>
</row> </row>
<row> <row>
<entry>field_order</entry> <entry>field_order</entry>
@@ -200,7 +195,6 @@
<entry>If supplied then the first element of the year's select-box has this <entry>If supplied then the first element of the year's select-box has this
value as it's label and "" as it's value. This is useful to make the value as it's label and "" as it's value. This is useful to make the
select-box read "Please select a year" for example. select-box read "Please select a year" for example.
Note that you can use values like "-MM-DD" as time-attribute to indicate Note that you can use values like "-MM-DD" as time-attribute to indicate
an unselected year.</entry> an unselected year.</entry>
</row> </row>
@@ -336,7 +330,14 @@ This will output: (current year is 2000)
]]> ]]>
</screen> </screen>
</example> </example>
<para>
See also <link linkend="language.function.html.select.time">html_select_time</link>,
<link linkend="language.modifier.date.format">date_format</link>,
<link linkend="language.variables.smarty.now">$smarty.now</link>
and <link linkend="tips.dates">date tips</link>.
</para>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml

View File

@@ -67,8 +67,8 @@ Cold Wave Linked to Temperatures.
]]> ]]>
</screen> </screen>
</example> </example>
<para>See also <link linkend="language.modifier.count.paragraphs">count_paragraphs</link> <para>See also <link linkend="language.modifier.count.paragraphs">count_paragraphs</link>,
<link linkend="language.modifier.count.sentences">count_sentences</link> <link linkend="language.modifier.count.sentences">count_sentences</link> and
<link linkend="language.modifier.count.words">count_words</link> <link linkend="language.modifier.count.words">count_words</link>
</para> </para>

View File

@@ -38,8 +38,8 @@ Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation.
]]> ]]>
</screen> </screen>
</example> </example>
<para>See also <link linkend="language.modifier.count.characters">count_characters</link> <para>See also <link linkend="language.modifier.count.characters">count_characters</link>,
<link linkend="language.modifier.count.sentences">count_sentences</link> <link linkend="language.modifier.count.sentences">count_sentences</link> and
<link linkend="language.modifier.count.words">count_words</link> <link linkend="language.modifier.count.words">count_words</link>
</para> </para>

View File

@@ -37,8 +37,8 @@ Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.
]]> ]]>
</screen> </screen>
</example> </example>
<para>See also <link linkend="language.modifier.count.characters">count_characters</link> <para>See also <link linkend="language.modifier.count.characters">count_characters</link>,
<link linkend="language.modifier.count.paragraphs">count_paragraphs</link> <link linkend="language.modifier.count.paragraphs">count_paragraphs</link> and
<link linkend="language.modifier.count.words">count_words</link> <link linkend="language.modifier.count.words">count_words</link>
</para> </para>

View File

@@ -37,8 +37,8 @@ Dealers Will Hear Car Talk at Noon.
]]> ]]>
</screen> </screen>
</example> </example>
<para>See also <link linkend="language.modifier.count.characters">count_characters</link> <para>See also <link linkend="language.modifier.count.characters">count_characters</link>,
<link linkend="language.modifier.count.paragraphs">count_paragraphs</link> <link linkend="language.modifier.count.paragraphs">count_paragraphs</link> and
<link linkend="language.modifier.count.sentences">count_sentences</link> <link linkend="language.modifier.count.sentences">count_sentences</link>
</para> </para>

View File

@@ -37,9 +37,9 @@
</tgroup> </tgroup>
</informaltable> </informaltable>
<para> <para>
This formats a date and time into the given strftime() format. This formats a date and time into the given <ulink url="&url.php-manual;strftime">strftime()</ulink> format.
Dates can be passed to Smarty as unix timestamps, mysql timestamps Dates can be passed to Smarty as unix timestamps, mysql timestamps
or any string made up of month day year (parsable by strtotime). 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 Designers can then use date_format to have complete control of the
formatting of the date. If the date passed to date_format is empty formatting of the date. If the date passed to date_format is empty
and a second parameter is passed, that will be used as the date to and a second parameter is passed, that will be used as the date to
@@ -211,6 +211,7 @@ Monday, February 5, 2001
</para> </para>
</note> </note>
</para> </para>
<para>See also <link linkend="language.variables.smarty.now">$smarty.now</link>, <link linkend="language.function.html.select.date">{html_select_date}</link> and <link linkend="tips.dates">date tips</link></para>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -67,6 +67,8 @@ no title
]]> ]]>
</screen> </screen>
</example> </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></para>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -76,12 +76,12 @@ $smarty->display('index.tpl');
&#039;Stiff Opposition Expected to Casketless Funeral Plan&#039; &#039;Stiff Opposition Expected to Casketless Funeral Plan&#039;
%27Stiff+Opposition+Expected+to+Casketless+Funeral+Plan%27 %27Stiff+Opposition+Expected+to+Casketless+Funeral+Plan%27
\'Stiff Opposition Expected to Casketless Funeral Plan\' \'Stiff Opposition Expected to Casketless Funeral Plan\'
<a href="mailto:%62%6f%62%40%6d%65%2e%6e%65%74">&#x62;&#x6f;&#x62;&#x40;&#x6d;&#x65;&#x2e;&#x6e;&#x65;&#x74;</a> <a href="mailto:%62%6f%..snip..%65%74">&#x62;&#x6f;&#x62..snip..&#x65;&#x74;</a>
]]> ]]>
</screen> </screen>
</example> </example>
<para> <para>
See also <link linkend="language.escaping">Escaping Smarty Parsing</link>. See also <link linkend="language.escaping">Escaping Smarty Parsing</link> and <link linkend="tips.obfuscating.email">Obfuscating E-mail Addresses</link>.
</para> </para>
</sect1> </sect1>

View File

@@ -4,7 +4,7 @@
<title>nl2br</title> <title>nl2br</title>
<para> <para>
All linebreaks will be converted to &lt;br /&gt; tags in the given All linebreaks will be converted to &lt;br /&gt; tags in the given
variable. This is equivalent to the PHP nl2br() function. variable. This is equivalent to the PHP <ulink url="&url.php-manual;nl2br">nl2br()</ulink> function.
</para> </para>
<example> <example>
<title>nl2br</title> <title>nl2br</title>
@@ -36,6 +36,7 @@ Sun or rain expected<br />today, dark tonight
]]> ]]>
</screen> </screen>
</example> </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></para>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -108,6 +108,7 @@ years.
]]> ]]>
</screen> </screen>
</example> </example>
<para>See also <link linkend="language.modifier.nl2br">nl2br</link></para>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -87,8 +87,9 @@ rowBgColor = "#cccccc"
<para> <para>
Config file variables cannot be used until Config file variables cannot be used until
after they are loaded in from a config file. This procedure is after they are loaded in from a config file. This procedure is
explained later in this document under <command>config_load</command>. explained later in this document under <link linkend="api.config.load"><command>config_load</command></link>.
</para> </para>
<para>See also <link linkend="language.syntax.variables">Variables</link> and <link linkend="language.variables.smarty">$smarty reserved variables</link></para>
</sect1> </sect1>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.variables.smarty"> <sect1 id="language.variables.smarty">
<title>{$smarty} reserved variable</title> <title>{$smarty} reserved variables</title>
<para> <para>
The reserved {$smarty} variable can be used to access several The reserved {$smarty} variable can be used to access several
special template variables. The full list of them follows. special template variables. The full list of them follows.
@@ -56,7 +56,7 @@
The current timestamp can be accessed with {$smarty.now}. The The current timestamp can be accessed with {$smarty.now}. The
number reflects the number of seconds passed since the so-called number reflects the number of seconds passed since the so-called
Epoch (January 1, 1970) and can be passed directly to Epoch (January 1, 1970) and can be passed directly to
date_format modifier for display purposes. <link linkend="language.modifier.date.format">date_format</link> modifier for display purposes.
</para> </para>
<example> <example>
<title>using {$smarty.now}</title> <title>using {$smarty.now}</title>
@@ -137,6 +137,7 @@
This variable is used for printing the right-delimiter value literally. This variable is used for printing the right-delimiter value literally.
See also <link linkend="language.function.ldelim">{ldelim},{rdelim}</link>. See also <link linkend="language.function.ldelim">{ldelim},{rdelim}</link>.
</para> </para>
<para>See also <link linkend="language.syntax.variables">Variables</link> and <link linkend="language.config.variables">Config Variables</link></para>
</sect2> </sect2>
</sect1> </sect1>