* some wz

* no tab
* add Cdata section
This commit is contained in:
yannick
2005-05-10 11:42:40 +00:00
parent e48ef064fe
commit 6793e12b17
10 changed files with 1674 additions and 1524 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.function.foreach"> <sect1 id="language.function.foreach">
<title>foreach,foreachelse</title> <title>foreach,foreachelse</title>
<informaltable frame="all"> <informaltable frame="all">
<tgroup cols="5"> <tgroup cols="5">
@@ -70,49 +70,63 @@
<emphasis>foreachelse</emphasis> is executed when there are no <emphasis>foreachelse</emphasis> is executed when there are no
values in the <emphasis>from</emphasis> variable. values in the <emphasis>from</emphasis> variable.
</para> </para>
<example> <example>
<title>foreach</title> <title>foreach</title>
<programlisting> <programlisting>
<![CDATA[
{* this example will print out all the values of the $custid array *} {* this example will print out all the values of the $custid array *}
{foreach from=$custid item=curr_id} {foreach from=$custid item=curr_id}
id: {$curr_id}&lt;br&gt; id: {$curr_id}<br />
{/foreach}
OUTPUT:
id: 1000&lt;br&gt;
id: 1001&lt;br&gt;
id: 1002&lt;br&gt;</programlisting>
</example>
<example>
<title>foreach key</title>
<programlisting>
{* The key contains the key for each looped value
assignment looks like this:
$smarty->assign("contacts", array(array("phone" =&gt; "1", "fax" =&gt; "2", "cell" =&gt; "3"),
array("phone" =&gt; "555-4444", "fax" =&gt; "555-3333", "cell" =&gt; "760-1234")));
*}
{foreach name=outer item=contact from=$contacts}
{foreach key=key item=item from=$contact}
{$key}: {$item}&lt;br&gt;
{/foreach} {/foreach}
{/foreach} ]]>
</programlisting>
<para>
The above example will output:
</para>
<screen>
<![CDATA[
id: 1000<br />
id: 1001<br />
id: 1002<br />
]]>
</screen>
</example>
OUTPUT: <example>
<title>foreach key</title>
<programlisting>
<![CDATA[
{* The key contains the key for each looped value
phone: 1&lt;br&gt; assignment looks like this:
fax: 2&lt;br&gt;
cell: 3&lt;br&gt; $smarty->assign("contacts", array(array("phone" => "1", "fax" => "2", "cell" => "3"),
phone: 555-4444&lt;br&gt; array("phone" => "555-4444", "fax" => "555-3333", "cell" => "760-1234")));
fax: 555-3333&lt;br&gt;
cell: 760-1234&lt;br&gt;</programlisting> *}
</example>
{foreach name=outer item=contact from=$contacts}
{foreach key=key item=item from=$contact}
{$key}: {$item}<br />
{/foreach}
{/foreach}
]]>
</programlisting>
<para>
The above example will output:
</para>
<screen>
<![CDATA[
phone: 1<br />
fax: 2<br />
cell: 3<br />
phone: 555-4444<br />
fax: 555-3333<br />
cell: 760-1234<br />
]]>
</screen>
</example>
<para> <para>
Foreach-loops also have their own variables that handle foreach properties. Foreach-loops also have their own variables that handle foreach properties.
@@ -121,7 +135,6 @@ cell: 760-1234&lt;br&gt;</programlisting>
attribute of foreach attribute of foreach
</para> </para>
<sect2 id="foreach.property.iteration"> <sect2 id="foreach.property.iteration">
<title>iteration</title> <title>iteration</title>
<para> <para>
@@ -166,29 +179,24 @@ cell: 760-1234&lt;br&gt;</programlisting>
will loop. This can be used inside or after the foreach. will loop. This can be used inside or after the foreach.
</para> </para>
</sect2> </sect2>
</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
sgml-omittag:t sgml-omittag:t
sgml-shorttag:t sgml-shorttag:t
sgml-minimize-attributes:nil sgml-minimize-attributes:nil
sgml-always-quote-attributes:t sgml-always-quote-attributes:t
sgml-indent-step:1 sgml-indent-step:1
sgml-indent-data:t sgml-indent-data:t
indent-tabs-mode:nil indent-tabs-mode:nil
sgml-parent-document:nil sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced" sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil sgml-exposed-tags:nil
sgml-local-catalogs:nil sgml-local-catalogs:nil
sgml-local-ecat-files:nil sgml-local-ecat-files:nil
End: End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.function.if"> <sect1 id="language.function.if">
<title>if,elseif,else</title> <title>if,elseif,else</title>
<para> <para>
<emphasis>{if}</emphasis> statements in Smarty have much the same flexibility as PHP if <emphasis>{if}</emphasis> statements in Smarty have much the same flexibility as PHP if
@@ -136,89 +136,92 @@
</tbody> </tbody>
</tgroup> </tgroup>
</informaltable> </informaltable>
<example> <example>
<title>if statements</title> <title>if statements</title>
<programlisting> <programlisting>
{if $name eq "Fred"} <![CDATA[
{if $name eq "Fred"}
Welcome Sir. Welcome Sir.
{elseif $name eq "Wilma"} {elseif $name eq "Wilma"}
Welcome Ma'am. Welcome Ma'am.
{else} {else}
Welcome, whatever you are. Welcome, whatever you are.
{/if} {/if}
{* an example with "or" logic *} {* an example with "or" logic *}
{if $name eq "Fred" or $name eq "Wilma"} {if $name eq "Fred" or $name eq "Wilma"}
... ...
{/if} {/if}
{* same as above *} {* same as above *}
{if $name == "Fred" || $name == "Wilma"} {if $name == "Fred" || $name == "Wilma"}
... ...
{/if} {/if}
{* the following syntax will NOT work, conditional qualifiers {* the following syntax will NOT work, conditional qualifiers
must be separated from surrounding elements by spaces *} must be separated from surrounding elements by spaces *}
{if $name=="Fred" || $name=="Wilma"} {if $name=="Fred" || $name=="Wilma"}
... ...
{/if} {/if}
{* parenthesis are allowed *} {* parenthesis are allowed *}
{if ( $amount &lt; 0 or $amount &gt; 1000 ) and $volume >= #minVolAmt#} {if ( $amount < 0 or $amount > 1000 ) and $volume >= #minVolAmt#}
... ...
{/if} {/if}
{* you can also embed php function calls *} {* you can also embed php function calls *}
{if count($var) gt 0} {if count($var) gt 0}
... ...
{/if} {/if}
{* test if values are even or odd *} {* test if values are even or odd *}
{if $var is even} {if $var is even}
... ...
{/if} {/if}
{if $var is odd} {if $var is odd}
... ...
{/if} {/if}
{if $var is not odd} {if $var is not odd}
... ...
{/if} {/if}
{* test if var is divisible by 4 *} {* test if var is divisible by 4 *}
{if $var is div by 4} {if $var is div by 4}
... ...
{/if} {/if}
{* test if var is even, grouped by two. i.e., {* test if var is even, grouped by two. i.e.,
0=even, 1=even, 2=odd, 3=odd, 4=even, 5=even, etc. *} 0=even, 1=even, 2=odd, 3=odd, 4=even, 5=even, etc. *}
{if $var is even by 2} {if $var is even by 2}
... ...
{/if} {/if}
{* 0=even, 1=even, 2=even, 3=odd, 4=odd, 5=odd, etc. *} {* 0=even, 1=even, 2=even, 3=odd, 4=odd, 5=odd, etc. *}
{if $var is even by 3} {if $var is even by 3}
... ...
{/if}</programlisting> {/if}
</example> ]]>
</programlisting>
</example>
</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
sgml-omittag:t sgml-omittag:t
sgml-shorttag:t sgml-shorttag:t
sgml-minimize-attributes:nil sgml-minimize-attributes:nil
sgml-always-quote-attributes:t sgml-always-quote-attributes:t
sgml-indent-step:1 sgml-indent-step:1
sgml-indent-data:t sgml-indent-data:t
indent-tabs-mode:nil indent-tabs-mode:nil
sgml-parent-document:nil sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced" sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil sgml-exposed-tags:nil
sgml-local-catalogs:nil sgml-local-catalogs:nil
sgml-local-ecat-files:nil sgml-local-ecat-files:nil
End: End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.function.include.php"> <sect1 id="language.function.include.php">
<title>include_php</title> <title>include_php</title>
<informaltable frame="all"> <informaltable frame="all">
<tgroup cols="5"> <tgroup cols="5">
@@ -91,13 +91,14 @@
The smarty object is available as $this within the PHP script that you The smarty object is available as $this within the PHP script that you
include. include.
</para> </para>
<example> <example>
<title>function include_php</title> <title>function include_php</title>
<programlisting> <programlisting>
load_nav.php <![CDATA[
------------- load_nav.php
-------------
&lt;?php <?php
// load in variables from a mysql db and assign them to the template // load in variables from a mysql db and assign them to the template
require_once("MySQL.class.php"); require_once("MySQL.class.php");
@@ -105,37 +106,40 @@ load_nav.php
$sql->query("select * from site_nav_sections order by name",SQL_ALL); $sql->query("select * from site_nav_sections order by name",SQL_ALL);
$this->assign('sections',$sql->record); $this->assign('sections',$sql->record);
?&gt; ?>
]]>
</programlisting>
<para>
Where index.pl is:
</para>
<programlisting>
<![CDATA[
{* absolute path, or relative to $trusted_dir *}
{include_php file="/path/to/load_nav.php"}
{foreach item="curr_section" from=$sections}
index.tpl <a href="{$curr_section.url}">{$curr_section.name}</a><br />
--------- {/foreach}
]]>
{* absolute path, or relative to $trusted_dir *} </programlisting>
{include_php file="/path/to/load_nav.php"} </example>
{foreach item="curr_section" from=$sections}
&lt;a href="{$curr_section.url}"&gt;{$curr_section.name}&lt;/a&gt;&lt;br&gt;
{/foreach}</programlisting>
</example>
</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
sgml-omittag:t sgml-omittag:t
sgml-shorttag:t sgml-shorttag:t
sgml-minimize-attributes:nil sgml-minimize-attributes:nil
sgml-always-quote-attributes:t sgml-always-quote-attributes:t
sgml-indent-step:1 sgml-indent-step:1
sgml-indent-data:t sgml-indent-data:t
indent-tabs-mode:nil indent-tabs-mode:nil
sgml-parent-document:nil sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced" sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil sgml-exposed-tags:nil
sgml-local-catalogs:nil sgml-local-catalogs:nil
sgml-local-ecat-files:nil sgml-local-ecat-files:nil
End: End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
-->

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.function.section"> <sect1 id="language.function.section">
<title>section,sectionelse</title> <title>section,sectionelse</title>
<informaltable frame="all"> <informaltable frame="all">
<tgroup cols="5"> <tgroup cols="5">
@@ -88,150 +88,178 @@
[]. <emphasis>sectionelse</emphasis> is []. <emphasis>sectionelse</emphasis> is
executed when there are no values in the loop variable. executed when there are no values in the loop variable.
</para> </para>
<example> <example>
<title>section</title> <title>section</title>
<programlisting> <programlisting>
<![CDATA[
{* this example will print out all the values of the $custid array *}
{section name=customer loop=$custid}
id: {$custid[customer]}<br />
{/section}
]]>
</programlisting>
<para>
The above example will output:
</para>
<screen>
<![CDATA[
id: 1000<br />
id: 1001<br />
id: 1002<br />
]]>
</screen>
</example>
{* this example will print out all the values of the $custid array *} <example>
{section name=customer loop=$custid} <title>section loop variable</title>
id: {$custid[customer]}&lt;br&gt; <programlisting>
{/section} <![CDATA[
{* the loop variable only determines the number of times to loop.
OUTPUT:
id: 1000&lt;br&gt;
id: 1001&lt;br&gt;
id: 1002&lt;br&gt;</programlisting>
</example>
<example>
<title>section loop variable</title>
<programlisting>
{* the loop variable only determines the number of times to loop.
you can access any variable from the template within the section. you can access any variable from the template within the section.
This example assumes that $custid, $name and $address are all This example assumes that $custid, $name and $address are all
arrays containing the same number of values *} arrays containing the same number of values *}
{section name=customer loop=$custid} {section name=customer loop=$custid}
id: {$custid[customer]}&lt;br&gt; id: {$custid[customer]}<br />
name: {$name[customer]}&lt;br&gt; name: {$name[customer]}<br />
address: {$address[customer]}&lt;br&gt; address: {$address[customer]}<br />
&lt;p&gt; <p>
{/section} {/section}
]]>
</programlisting>
<para>
The above example will output:
</para>
<screen>
<![CDATA[
id: 1000<br />
name: John Smith<br />
address: 253 N 45th<br />
<p>
id: 1001<br />
name: Jack Jones<br />
address: 417 Mulberry ln<br />
<p>
id: 1002<br />
name: Jane Munson<br />
address: 5605 apple st<br />
<p>
]]>
</screen>
</example>
<example>
OUTPUT: <title>section names</title>
<programlisting>
id: 1000&lt;br&gt; <![CDATA[
name: John Smith&lt;br&gt; {* the name of the section can be anything you like,
address: 253 N 45th&lt;br&gt;
&lt;p&gt;
id: 1001&lt;br&gt;
name: Jack Jones&lt;br&gt;
address: 417 Mulberry ln&lt;br&gt;
&lt;p&gt;
id: 1002&lt;br&gt;
name: Jane Munson&lt;br&gt;
address: 5605 apple st&lt;br&gt;
&lt;p&gt;</programlisting>
</example>
<example>
<title>section names</title>
<programlisting>
{* the name of the section can be anything you like,
and it is used to reference the data within the section *} and it is used to reference the data within the section *}
{section name=mydata loop=$custid} {section name=mydata loop=$custid}
id: {$custid[mydata]}&lt;br&gt; id: {$custid[mydata]}<br />
name: {$name[mydata]}&lt;br&gt; name: {$name[mydata]}<br />
address: {$address[mydata]}&lt;br&gt; address: {$address[mydata]}<br />
&lt;p&gt; <p>
{/section}</programlisting> {/section}
</example> ]]>
</programlisting>
</example>
<example> <example>
<title>nested sections</title> <title>nested sections</title>
<programlisting> <programlisting>
{* sections can be nested as deep as you like. With nested sections, <![CDATA[
{* sections can be nested as deep as you like. With nested sections,
you can access complex data structures, such as multi-dimensional you can access complex data structures, such as multi-dimensional
arrays. In this example, $contact_type[customer] is an array of arrays. In this example, $contact_type[customer] is an array of
contact types for the current customer. *} contact types for the current customer. *}
{section name=customer loop=$custid} {section name=customer loop=$custid}
id: {$custid[customer]}&lt;br&gt; id: {$custid[customer]}<br />
name: {$name[customer]}&lt;br&gt; name: {$name[customer]}<br />
address: {$address[customer]}&lt;br&gt; address: {$address[customer]}<br />
{section name=contact loop=$contact_type[customer]} {section name=contact loop=$contact_type[customer]}
{$contact_type[customer][contact]}: {$contact_info[customer][contact]}&lt;br&gt; {$contact_type[customer][contact]}: {$contact_info[customer][contact]}<br />
{/section} {/section}
&lt;p&gt; <p>
{/section} {/section}
]]>
</programlisting>
<para>
The above example will output:
</para>
<screen>
<![CDATA[
id: 1000<br />
name: John Smith<br />
address: 253 N 45th<br />
home phone: 555-555-5555<br />
cell phone: 555-555-5555<br />
e-mail: john@myexample.com<br />
<p>
id: 1001<br />
name: Jack Jones<br />
address: 417 Mulberry ln<br />
home phone: 555-555-5555<br />
cell phone: 555-555-5555<br />
e-mail: jack@myexample.com<br />
<p>
id: 1002<br />
name: Jane Munson<br />
address: 5605 apple st<br />
home phone: 555-555-5555<br />
cell phone: 555-555-5555<br />
e-mail: jane@myexample.com<br />
<p>
]]>
</screen>
</example>
<example>
OUTPUT: <title>sections and associative arrays</title>
<programlisting>
id: 1000&lt;br&gt; <![CDATA[
name: John Smith&lt;br&gt; {* This is an example of printing an associative array
address: 253 N 45th&lt;br&gt;
home phone: 555-555-5555&lt;br&gt;
cell phone: 555-555-5555&lt;br&gt;
e-mail: john@myexample.com&lt;br&gt;
&lt;p&gt;
id: 1001&lt;br&gt;
name: Jack Jones&lt;br&gt;
address: 417 Mulberry ln&lt;br&gt;
home phone: 555-555-5555&lt;br&gt;
cell phone: 555-555-5555&lt;br&gt;
e-mail: jack@myexample.com&lt;br&gt;
&lt;p&gt;
id: 1002&lt;br&gt;
name: Jane Munson&lt;br&gt;
address: 5605 apple st&lt;br&gt;
home phone: 555-555-5555&lt;br&gt;
cell phone: 555-555-5555&lt;br&gt;
e-mail: jane@myexample.com&lt;br&gt;
&lt;p&gt;</programlisting>
</example>
<example>
<title>sections and associative arrays</title>
<programlisting>
{* This is an example of printing an associative array
of data within a section *} of data within a section *}
{section name=customer loop=$contacts} {section name=customer loop=$contacts}
name: {$contacts[customer].name}&lt;br&gt; name: {$contacts[customer].name}<br />
home: {$contacts[customer].home}&lt;br&gt; home: {$contacts[customer].home}<br />
cell: {$contacts[customer].cell}&lt;br&gt; cell: {$contacts[customer].cell}<br />
e-mail: {$contacts[customer].email}&lt;p&gt; e-mail: {$contacts[customer].email}<p>
{/section} {/section}
]]>
</programlisting>
<para>
The above example will output:
</para>
<screen>
<![CDATA[
name: John Smith<br />
home: 555-555-5555<br />
cell: 555-555-5555<br />
e-mail: john@myexample.com<p>
name: Jack Jones<br />
home phone: 555-555-5555<br />
cell phone: 555-555-5555<br />
e-mail: jack@myexample.com<p>
name: Jane Munson<br />
home phone: 555-555-5555<br />
cell phone: 555-555-5555<br />
e-mail: jane@myexample.com<p>
]]>
</screen>
</example>
<example>
OUTPUT: <title>sectionelse</title>
<programlisting>
name: John Smith&lt;br&gt; <![CDATA[
home: 555-555-5555&lt;br&gt; {* sectionelse will execute if there are no $custid values *}
cell: 555-555-5555&lt;br&gt; {section name=customer loop=$custid}
e-mail: john@myexample.com&lt;p&gt; id: {$custid[customer]}<br />
name: Jack Jones&lt;br&gt; {sectionelse}
home phone: 555-555-5555&lt;br&gt;
cell phone: 555-555-5555&lt;br&gt;
e-mail: jack@myexample.com&lt;p&gt;
name: Jane Munson&lt;br&gt;
home phone: 555-555-5555&lt;br&gt;
cell phone: 555-555-5555&lt;br&gt;
e-mail: jane@myexample.com&lt;p&gt;</programlisting>
</example>
<example>
<title>sectionelse</title>
<programlisting>
{* sectionelse will execute if there are no $custid values *}
{section name=customer loop=$custid}
id: {$custid[customer]}&lt;br&gt;
{sectionelse}
there are no values in $custid. there are no values in $custid.
{/section}</programlisting> {/section}
</example> ]]>
</programlisting>
</example>
<para> <para>
Sections also have their own variables that handle section properties. Sections also have their own variables that handle section properties.
These are indicated like so: {$smarty.section.sectionname.varname} These are indicated like so: {$smarty.section.sectionname.varname}
@@ -263,17 +291,22 @@ e-mail: jane@myexample.com&lt;p&gt;</programlisting>
<example> <example>
<title>section property index</title> <title>section property index</title>
<programlisting> <programlisting>
<![CDATA[
{section name=customer loop=$custid} {section name=customer loop=$custid}
{$smarty.section.customer.index} id: {$custid[customer]}&lt;br&gt; {$smarty.section.customer.index} id: {$custid[customer]}<br />
{/section} {/section}
]]>
</programlisting>
OUTPUT: <para>
The above example will output:
0 id: 1000&lt;br&gt; </para>
1 id: 1001&lt;br&gt; <screen>
2 id: 1002&lt;br&gt; <![CDATA[
</programlisting> 0 id: 1000<br />
1 id: 1001<br />
2 id: 1002<br />
]]>
</screen>
</example> </example>
</sect2> </sect2>
<sect2 id="section.property.index.prev"> <sect2 id="section.property.index.prev">
@@ -285,24 +318,29 @@ e-mail: jane@myexample.com&lt;p&gt;</programlisting>
<example> <example>
<title>section property index_prev</title> <title>section property index_prev</title>
<programlisting> <programlisting>
<![CDATA[
{section name=customer loop=$custid} {section name=customer loop=$custid}
{$smarty.section.customer.index} id: {$custid[customer]}&lt;br&gt; {$smarty.section.customer.index} id: {$custid[customer]}<br />
{* FYI, $custid[customer.index] and $custid[customer] are identical in meaning *} {* FYI, $custid[customer.index] and $custid[customer] are identical in meaning *}
{if $custid[customer.index_prev] ne $custid[customer.index]} {if $custid[customer.index_prev] ne $custid[customer.index]}
The customer id changed&lt;br&gt; The customer id changed<br />
{/if} {/if}
{/section} {/section}
]]>
</programlisting>
OUTPUT: <para>
The above example will output:
0 id: 1000&lt;br&gt; </para>
The customer id changed&lt;br&gt; <screen>
1 id: 1001&lt;br&gt; <![CDATA[
The customer id changed&lt;br&gt; 0 id: 1000<br />
2 id: 1002&lt;br&gt; The customer id changed<br />
The customer id changed&lt;br&gt; 1 id: 1001<br />
</programlisting> The customer id changed<br />
2 id: 1002<br />
The customer id changed<br />
]]>
</screen>
</example> </example>
</sect2> </sect2>
<sect2 id="section.property.index.next"> <sect2 id="section.property.index.next">
@@ -315,24 +353,29 @@ e-mail: jane@myexample.com&lt;p&gt;</programlisting>
<example> <example>
<title>section property index_next</title> <title>section property index_next</title>
<programlisting> <programlisting>
<![CDATA[
{section name=customer loop=$custid} {section name=customer loop=$custid}
{$smarty.section.customer.index} id: {$custid[customer]}&lt;br&gt; {$smarty.section.customer.index} id: {$custid[customer]}<br />
{* FYI, $custid[customer.index] and $custid[customer] are identical in meaning *} {* FYI, $custid[customer.index] and $custid[customer] are identical in meaning *}
{if $custid[customer.index_next] ne $custid[customer.index]} {if $custid[customer.index_next] ne $custid[customer.index]}
The customer id will change&lt;br&gt; The customer id will change<br />
{/if} {/if}
{/section} {/section}
]]>
</programlisting>
OUTPUT: <para>
The above example will output:
0 id: 1000&lt;br&gt; </para>
The customer id will change&lt;br&gt; <screen>
1 id: 1001&lt;br&gt; <![CDATA[
The customer id will change&lt;br&gt; 0 id: 1000<br />
2 id: 1002&lt;br&gt; The customer id will change<br />
The customer id will change&lt;br&gt; 1 id: 1001<br />
</programlisting> The customer id will change<br />
2 id: 1002<br />
The customer id will change<br />
]]>
</screen>
</example> </example>
</sect2> </sect2>
<sect2 id="section.property.iteration"> <sect2 id="section.property.iteration">
@@ -351,28 +394,33 @@ e-mail: jane@myexample.com&lt;p&gt;</programlisting>
<example> <example>
<title>section property iteration</title> <title>section property iteration</title>
<programlisting> <programlisting>
<![CDATA[
{section name=customer loop=$custid start=5 step=2} {section name=customer loop=$custid start=5 step=2}
current loop iteration: {$smarty.section.customer.iteration}&lt;br&gt; current loop iteration: {$smarty.section.customer.iteration}<br />
{$smarty.section.customer.index} id: {$custid[customer]}&lt;br&gt; {$smarty.section.customer.index} id: {$custid[customer]}<br />
{* FYI, $custid[customer.index] and $custid[customer] are identical in meaning *} {* FYI, $custid[customer.index] and $custid[customer] are identical in meaning *}
{if $custid[customer.index_next] ne $custid[customer.index]} {if $custid[customer.index_next] ne $custid[customer.index]}
The customer id will change&lt;br&gt; The customer id will change<br />
{/if} {/if}
{/section} {/section}
]]>
</programlisting>
OUTPUT: <para>
The above example will output:
</para>
<screen>
<![CDATA[
current loop iteration: 1 current loop iteration: 1
5 id: 1000&lt;br&gt; 5 id: 1000<br />
The customer id will change&lt;br&gt; The customer id will change<br />
current loop iteration: 2 current loop iteration: 2
7 id: 1001&lt;br&gt; 7 id: 1001<br />
The customer id will change&lt;br&gt; The customer id will change<br />
current loop iteration: 3 current loop iteration: 3
9 id: 1002&lt;br&gt; 9 id: 1002<br />
The customer id will change&lt;br&gt; The customer id will change<br />
</programlisting> ]]>
</screen>
</example> </example>
</sect2> </sect2>
<sect2 id="section.property.first"> <sect2 id="section.property.first">
@@ -384,28 +432,33 @@ e-mail: jane@myexample.com&lt;p&gt;</programlisting>
<example> <example>
<title>section property first</title> <title>section property first</title>
<programlisting> <programlisting>
<![CDATA[
{section name=customer loop=$custid} {section name=customer loop=$custid}
{if $smarty.section.customer.first} {if $smarty.section.customer.first}
&lt;table&gt; <table>
{/if} {/if}
&lt;tr&gt;&lt;td&gt;{$smarty.section.customer.index} id: <tr><td>{$smarty.section.customer.index} id:
{$custid[customer]}&lt;/td&gt;&lt;/tr&gt; {$custid[customer]}</td></tr>
{if $smarty.section.customer.last} {if $smarty.section.customer.last}
&lt;/table&gt; </table>
{/if} {/if}
{/section} {/section}
]]>
</programlisting>
OUTPUT: <para>
The above example will output:
&lt;table&gt; </para>
&lt;tr&gt;&lt;td&gt;0 id: 1000&lt;/td&gt;&lt;/tr&gt; <screen>
&lt;tr&gt;&lt;td&gt;1 id: 1001&lt;/td&gt;&lt;/tr&gt; <![CDATA[
&lt;tr&gt;&lt;td&gt;2 id: 1002&lt;/td&gt;&lt;/tr&gt; <table>
&lt;/table&gt; <tr><td>0 id: 1000</td></tr>
</programlisting> <tr><td>1 id: 1001</td></tr>
<tr><td>2 id: 1002</td></tr>
</table>
]]>
</screen>
</example> </example>
</sect2> </sect2>
<sect2 id="section.property.last"> <sect2 id="section.property.last">
@@ -417,28 +470,33 @@ e-mail: jane@myexample.com&lt;p&gt;</programlisting>
<example> <example>
<title>section property last</title> <title>section property last</title>
<programlisting> <programlisting>
<![CDATA[
{section name=customer loop=$custid} {section name=customer loop=$custid}
{if $smarty.section.customer.first} {if $smarty.section.customer.first}
&lt;table&gt; <table>
{/if} {/if}
&lt;tr&gt;&lt;td&gt;{$smarty.section.customer.index} id: <tr><td>{$smarty.section.customer.index} id:
{$custid[customer]}&lt;/td&gt;&lt;/tr&gt; {$custid[customer]}</td></tr>
{if $smarty.section.customer.last} {if $smarty.section.customer.last}
&lt;/table&gt; </table>
{/if} {/if}
{/section} {/section}
]]>
</programlisting>
OUTPUT: <para>
The above example will output:
&lt;table&gt; </para>
&lt;tr&gt;&lt;td&gt;0 id: 1000&lt;/td&gt;&lt;/tr&gt; <screen>
&lt;tr&gt;&lt;td&gt;1 id: 1001&lt;/td&gt;&lt;/tr&gt; <![CDATA[
&lt;tr&gt;&lt;td&gt;2 id: 1002&lt;/td&gt;&lt;/tr&gt; <table>
&lt;/table&gt; <tr><td>0 id: 1000</td></tr>
</programlisting> <tr><td>1 id: 1001</td></tr>
<tr><td>2 id: 1002</td></tr>
</table>
]]>
</screen>
</example> </example>
</sect2> </sect2>
<sect2 id="section.property.rownum"> <sect2 id="section.property.rownum">
@@ -451,17 +509,22 @@ e-mail: jane@myexample.com&lt;p&gt;</programlisting>
<example> <example>
<title>section property rownum</title> <title>section property rownum</title>
<programlisting> <programlisting>
<![CDATA[
{section name=customer loop=$custid} {section name=customer loop=$custid}
{$smarty.section.customer.rownum} id: {$custid[customer]}&lt;br&gt; {$smarty.section.customer.rownum} id: {$custid[customer]}<br />
{/section} {/section}
]]>
</programlisting>
OUTPUT: <para>
The above example will output:
1 id: 1000&lt;br&gt; </para>
2 id: 1001&lt;br&gt; <screen>
3 id: 1002&lt;br&gt; <![CDATA[
</programlisting> 1 id: 1000<br />
2 id: 1001<br />
3 id: 1002<br />
]]>
</screen>
</example> </example>
</sect2> </sect2>
<sect2 id="section.property.loop"> <sect2 id="section.property.loop">
@@ -473,20 +536,26 @@ e-mail: jane@myexample.com&lt;p&gt;</programlisting>
<example> <example>
<title>section property index</title> <title>section property index</title>
<programlisting> <programlisting>
<![CDATA[
{section name=customer loop=$custid} {section name=customer loop=$custid}
{$smarty.section.customer.index} id: {$custid[customer]}&lt;br&gt; {$smarty.section.customer.index} id: {$custid[customer]}<br />
{/section} {/section}
There were {$smarty.section.customer.loop} customers shown above. There were {$smarty.section.customer.loop} customers shown above.
]]>
OUTPUT: </programlisting>
<para>
0 id: 1000&lt;br&gt; The above example will output:
1 id: 1001&lt;br&gt; </para>
2 id: 1002&lt;br&gt; <screen>
<![CDATA[
0 id: 1000<br />
1 id: 1001<br />
2 id: 1002<br />
There were 3 customers shown above. There were 3 customers shown above.
</programlisting> ]]>
</screen>
</example> </example>
</sect2> </sect2>
<sect2 id="section.property.show"> <sect2 id="section.property.show">
@@ -500,10 +569,11 @@ e-mail: jane@myexample.com&lt;p&gt;</programlisting>
<example> <example>
<title>section attribute show</title> <title>section attribute show</title>
<programlisting> <programlisting>
<![CDATA[
{* $show_customer_info may have been passed from the PHP {* $show_customer_info may have been passed from the PHP
application, to regulate whether or not this section shows *} application, to regulate whether or not this section shows *}
{section name=customer loop=$custid show=$show_customer_info} {section name=customer loop=$custid show=$show_customer_info}
{$smarty.section.customer.rownum} id: {$custid[customer]}&lt;br&gt; {$smarty.section.customer.rownum} id: {$custid[customer]}<br />
{/section} {/section}
{if $smarty.section.customer.show} {if $smarty.section.customer.show}
@@ -511,16 +581,20 @@ e-mail: jane@myexample.com&lt;p&gt;</programlisting>
{else} {else}
the section was not shown. the section was not shown.
{/if} {/if}
]]>
</programlisting>
OUTPUT: <para>
The above example will output:
1 id: 1000&lt;br&gt; </para>
2 id: 1001&lt;br&gt; <screen>
3 id: 1002&lt;br&gt; <![CDATA[
1 id: 1000<br />
2 id: 1001<br />
3 id: 1002<br />
the section was shown. the section was shown.
</programlisting> ]]>
</screen>
</example> </example>
</sect2> </sect2>
<sect2 id="section.property.total"> <sect2 id="section.property.total">
@@ -532,20 +606,26 @@ e-mail: jane@myexample.com&lt;p&gt;</programlisting>
<example> <example>
<title>section property total</title> <title>section property total</title>
<programlisting> <programlisting>
<![CDATA[
{section name=customer loop=$custid step=2} {section name=customer loop=$custid step=2}
{$smarty.section.customer.index} id: {$custid[customer]}&lt;br&gt; {$smarty.section.customer.index} id: {$custid[customer]}<br />
{/section} {/section}
There were {$smarty.section.customer.total} customers shown above. There were {$smarty.section.customer.total} customers shown above.
]]>
OUTPUT: </programlisting>
<para>
0 id: 1000&lt;br&gt; The above example will output:
2 id: 1001&lt;br&gt; </para>
4 id: 1002&lt;br&gt; <screen>
<![CDATA[
0 id: 1000<br />
2 id: 1001<br />
4 id: 1002<br />
There were 3 customers shown above. There were 3 customers shown above.
</programlisting> ]]>
</screen>
</example> </example>
</sect2> </sect2>
</sect1> </sect1>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.function.eval"> <sect1 id="language.function.eval">
<title>eval</title> <title>eval</title>
<informaltable frame="all"> <informaltable frame="all">
<tgroup cols="5"> <tgroup cols="5">
@@ -63,39 +63,48 @@
output will be cached with the rest of the template. output will be cached with the rest of the template.
</para> </para>
</note> </note>
<example> <example>
<title>eval</title> <title>eval</title>
<programlisting> <programlisting>
setup.conf <![CDATA[
---------- setup.conf
----------
emphstart = &lt;b&gt; emphstart = <strong>
emphend = &lt;/b&gt; emphend = </strong>
title = Welcome to {$company}'s home page! title = Welcome to {$company}'s home page!
ErrorCity = You must supply a {#emphstart#}city{#emphend#}. ErrorCity = You must supply a {#emphstart#}city{#emphend#}.
ErrorState = You must supply a {#emphstart#}state{#emphend#}. ErrorState = You must supply a {#emphstart#}state{#emphend#}.
]]>
</programlisting>
<para>
Where index.tpl is:
</para>
<programlisting>
<![CDATA[
{config_load file="setup.conf"}
{eval var=$foo}
{eval var=#title#}
{eval var=#ErrorCity#}
{eval var=#ErrorState# assign="state_error"}
{$state_error}
]]>
</programlisting>
<para>
The above example will output:
</para>
<screen>
<![CDATA[
index.tpl This is the contents of foo.
--------- Welcome to Foobar Pub & Grill's home page!
You must supply a <strong>city</strong>.
You must supply a <strong>state</strong>.
{config_load file="setup.conf"} ]]>
</screen>
{eval var=$foo} </example>
{eval var=#title#}
{eval var=#ErrorCity#}
{eval var=#ErrorState# assign="state_error"}
{$state_error}
OUTPUT:
This is the contents of foo.
Welcome to Foobar Pub &amp; Grill's home page!
You must supply a &lt;b&gt;city&lt;/b&gt;.
You must supply a &lt;b&gt;state&lt;/b&gt;.
</programlisting>
</example>
</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,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.function.html.image"> <sect1 id="language.function.html.image">
<title>html_image</title> <title>html_image</title>
<informaltable frame="all"> <informaltable frame="all">
<tgroup cols="5"> <tgroup cols="5">
@@ -98,12 +98,12 @@
<![CDATA[ <![CDATA[
<?php <?php
require('Smarty.class.php'); require('Smarty.class.php');
$smarty = new Smarty; $smarty = new Smarty;
$smarty->display('index.tpl'); $smarty->display('index.tpl');
?> ?>
]]> ]]>
</programlisting> </programlisting>
<para> <para>
where index.tpl is: where index.tpl is:

View File

@@ -70,86 +70,106 @@
</para> </para>
<para> <para>
If the optional <emphasis>name</emphasis> attribute is given, the If the optional <emphasis>name</emphasis> attribute is given, the
&lt;select name="groupname"&gt;&lt;/select&gt; tags will enclose <select name="groupname"></select> tags will enclose
the option list. Otherwise only the option list is generated. the option list. Otherwise only the option list is generated.
</para> </para>
<para> <para>
All parameters that are not in the list above are printed as All parameters that are not in the list above are printed as
name/value-pairs inside the &lt;select&gt;-tag. They are ignored if name/value-pairs inside the <select>-tag. They are ignored if
the optional <emphasis>name</emphasis> is not given. the optional <emphasis>name</emphasis> is not given.
</para> </para>
<example> <example>
<title>html_options</title> <title>html_options : Example 1</title>
<programlisting> <programlisting>
EXAMPLE 1 <![CDATA[
--------- index.php:
----------
index.php: require('Smarty.class.php');
$smarty = new Smarty;
$smarty->assign('cust_ids', array(1000,1001,1002,1003));
$smarty->assign('cust_names', array('Joe Schmoe','Jack Smith','Jane
Johnson','Charlie Brown'));
$smarty->assign('customer_id', 1001);
$smarty->display('index.tpl');
]]>
</programlisting>
<para>
Where index.tpl is:
</para>
<programlisting>
<![CDATA[
require('Smarty.class.php'); <select name=customer_id>
$smarty = new Smarty;
$smarty-&gt;assign('cust_ids', array(1000,1001,1002,1003));
$smarty-&gt;assign('cust_names', array('Joe Schmoe','Jack Smith','Jane
Johnson','Charlie Brown'));
$smarty-&gt;assign('customer_id', 1001);
$smarty-&gt;display('index.tpl');
index.tpl:
&lt;select name=customer_id&gt;
{html_options values=$cust_ids selected=$customer_id output=$cust_names} {html_options values=$cust_ids selected=$customer_id output=$cust_names}
&lt;/select&gt; </select>
]]>
</programlisting>
<para>
Example 2
</para>
<programlisting>
<![CDATA[
index.php:
----------
EXAMPLE 2 require('Smarty.class.php');
--------- $smarty = new Smarty;
$smarty->assign('cust_options', array(
1001 => 'Joe Schmoe',
1002 => 'Jack Smith',
1003 => 'Jane Johnson',
1004 => 'Charlie Brown'));
$smarty->assign('customer_id', 1001);
$smarty->display('index.tpl');
]]>
</programlisting>
<para>
Where index.tpl is:
</para>
<programlisting>
<![CDATA[
index.php: <select name=customer_id>
require('Smarty.class.php');
$smarty = new Smarty;
$smarty-&gt;assign('cust_options', array(
1001 =&gt; 'Joe Schmoe',
1002 =&gt; 'Jack Smith',
1003 =&gt; 'Jane Johnson',
1004 =&gt; 'Charlie Brown'));
$smarty-&gt;assign('customer_id', 1001);
$smarty-&gt;display('index.tpl');
index.tpl:
&lt;select name=customer_id&gt;
{html_options options=$cust_options selected=$customer_id} {html_options options=$cust_options selected=$customer_id}
&lt;/select&gt; </select>
]]>
</programlisting>
<para>
Both examples will output:
</para>
<screen>
<![CDATA[
OUTPUT: (both examples) <select name=customer_id>
----------------------- <option label="Joe Schmoe" value="1000">Joe Schmoe</option>
<option label="Jack Smith" value="1001" selected="selected">Jack Smith</option>
<option label="Jane Johnson" value="1002">Jane Johnson</option>
<option label="Charlie Brown" value="1003">Charlie Brown</option>
</select>
&lt;select name=customer_id&gt; ]]>
&lt;option label="Joe Schmoe" value="1000"&gt;Joe Schmoe&lt;/option&gt; </screen>
&lt;option label="Jack Smith" value="1001" selected="selected"&gt;Jack Smith&lt;/option&gt; </example>
&lt;option label="Jane Johnson" value="1002"&gt;Jane Johnson&lt;/option&gt;
&lt;option label="Charlie Brown" value="1003"&gt;Charlie Brown&lt;/option&gt;
&lt;/select&gt;</programlisting>
</example>
</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
sgml-omittag:t sgml-omittag:t
sgml-shorttag:t sgml-shorttag:t
sgml-minimize-attributes:nil sgml-minimize-attributes:nil
sgml-always-quote-attributes:t sgml-always-quote-attributes:t
sgml-indent-step:1 sgml-indent-step:1
sgml-indent-data:t sgml-indent-data:t
indent-tabs-mode:nil indent-tabs-mode:nil
sgml-parent-document:nil sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced" sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil sgml-exposed-tags:nil
sgml-local-catalogs:nil sgml-local-catalogs:nil
sgml-local-ecat-files:nil sgml-local-ecat-files:nil
End: End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="language.function.html.radios"> <sect1 id="language.function.html.radios">
<title>html_radios</title> <title>html_radios</title>
<informaltable frame="all"> <informaltable frame="all">
<tgroup cols="5"> <tgroup cols="5">
@@ -72,54 +72,74 @@
</para> </para>
<para> <para>
All parameters that are not in the list above are printed as All parameters that are not in the list above are printed as
name/value-pairs inside each of the created &lt;input&gt;-tags. name/value-pairs inside each of the created <input>-tags.
</para> </para>
<example> <example>
<title>html_radios</title> <title>html_radios : Example 1</title>
<programlisting> <programlisting>
index.php: <![CDATA[
index.php:
----------
require('Smarty.class.php'); require('Smarty.class.php');
$smarty = new Smarty; $smarty = new Smarty;
$smarty-&gt;assign('cust_ids', array(1000,1001,1002,1003)); $smarty->assign('cust_ids', array(1000,1001,1002,1003));
$smarty-&gt;assign('cust_names', array('Joe Schmoe','Jack Smith','Jane $smarty->assign('cust_names', array('Joe Schmoe','Jack Smith','Jane
Johnson','Charlie Brown')); Johnson','Charlie Brown'));
$smarty-&gt;assign('customer_id', 1001); $smarty->assign('customer_id', 1001);
$smarty-&gt;display('index.tpl'); $smarty->display('index.tpl');
]]>
</programlisting>
<para>
Where index.tpl is:
</para>
<programlisting>
<![CDATA[
{html_radios name="id" values=$cust_ids selected=$customer_id output=$cust_names separator="<br />"}
]]>
</programlisting>
<para>
Example 2 :
</para>
<programlisting>
<![CDATA[
index.php:
----------
require('Smarty.class.php');
index.tpl: $smarty = new Smarty;
$smarty->assign('cust_radios', array(
{html_radios name="id" values=$cust_ids selected=$customer_id output=$cust_names separator="&lt;br /&gt;"} 1000 => 'Joe Schmoe',
1001 => 'Jack Smith',
1002 => 'Jane Johnson',
index.php: 1003 => 'Charlie Brown'));
$smarty->assign('customer_id', 1001);
require('Smarty.class.php'); $smarty->display('index.tpl');
$smarty = new Smarty; ]]>
$smarty-&gt;assign('cust_radios', array( </programlisting>
1000 =&gt; 'Joe Schmoe', <para>
1001 =&gt; 'Jack Smith', Where index.tpl is:
1002 =&gt; 'Jane Johnson', </para>
1003 =&gt; 'Charlie Brown')); <programlisting>
$smarty-&gt;assign('customer_id', 1001); <![CDATA[
$smarty-&gt;display('index.tpl'); {html_radios name="id" options=$cust_radios selected=$customer_id separator="<br />"}
]]>
</programlisting>
index.tpl: <para>
Both examples will output:
{html_radios name="id" options=$cust_radios selected=$customer_id separator="&lt;br /&gt;"} </para>
<screen>
<![CDATA[
OUTPUT: (both examples) <label for="id_1000"><input type="radio" name="id" value="1000" id="id_1000" />Joe Schmoe</label><br />
<label for="id_1001"><input type="radio" name="id" value="1001" id="id_1001" checked="checked" />Jack Smith</label><br />
&lt;label for="id_1000"&gt;&lt;input type="radio" name="id" value="1000" id="id_1000" /&gt;Joe Schmoe&lt;/label&gt;&lt;br /&gt; <label for="id_1002"><input type="radio" name="id" value="1002" id="id_1002" />Jane Johnson</label><br />
&lt;label for="id_1001"&gt;&lt;input type="radio" name="id" value="1001" id="id_1001" checked="checked" /&gt;Jack Smith&lt;/label&gt;&lt;br /&gt; <label for="id_1003"><input type="radio" name="id" value="1003" id="id_1003" />Charlie Brown</label><br />
&lt;label for="id_1002"&gt;&lt;input type="radio" name="id" value="1002" id="id_1002" /&gt;Jane Johnson&lt;/label&gt;&lt;br /&gt; ]]>
&lt;label for="id_1003"&gt;&lt;input type="radio" name="id" value="1003" id="id_1003" /&gt;Charlie Brown&lt;/label&gt;&lt;br /&gt;</programlisting> </screen>
</example> </example>
</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

@@ -105,52 +105,58 @@
<example> <example>
<title>mailto</title> <title>mailto</title>
<programlisting> <programlisting>
{mailto address="me@example.com"} <![CDATA[
{mailto address="me@example.com" text="send me some mail"} {mailto address="me@example.com"}
{mailto address="me@example.com" encode="javascript"} {mailto address="me@example.com" text="send me some mail"}
{mailto address="me@example.com" encode="hex"} {mailto address="me@example.com" encode="javascript"}
{mailto address="me@example.com" subject="Hello to you!"} {mailto address="me@example.com" encode="hex"}
{mailto address="me@example.com" cc="you@example.com,they@example.com"} {mailto address="me@example.com" subject="Hello to you!"}
{mailto address="me@example.com" extra='class="email"'} {mailto address="me@example.com" cc="you@example.com,they@example.com"}
{mailto address="me@example.com" encode="javascript_charcode"} {mailto address="me@example.com" extra='class="email"'}
{mailto address="me@example.com" encode="javascript_charcode"}
]]>
OUTPUT: </programlisting>
<para>
&lt;a href="mailto:me@example.com" &gt;me@example.com&lt;/a&gt; The above example will output:
&lt;a href="mailto:me@example.com" &gt;send me some mail&lt;/a&gt; </para>
&lt;script type="text/javascript" language="javascript"&gt;eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%6 <screen>
9%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d% <![CDATA[
61%69%6e%2e%63%6f%6d%22%20%3e%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%3c%2f%61%3e <a href="mailto:me@example.com" >me@example.com</a>
%27%29%3b'))&lt;/script&gt; <a href="mailto:me@example.com" >send me some mail</a>
&lt;a href="mailto:%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d" &gt;&#x6d;&#x65;&#x40;&#x64;&#x6f;&#x6d;&#x61;&#x69;&#x6e;&#x2e;&#x63;&#x6f;&#x6d;&lt;/a&gt; <script type="text/javascript" language="javascript">eval(unescape('%64%6f%63%75%6d%65%6e%74%2e%77%72%6
&lt;a href="mailto:me@example.com?subject=Hello%20to%20you%21" &gt;me@example.com&lt;/a&gt; 9%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%6d%65%40%64%6f%6d%
&lt;a href="mailto:me@example.com?cc=you@example.com%2Cthey@example.com" &gt;me@example.com&lt;/a&gt; 61%69%6e%2e%63%6f%6d%22%20%3e%6d%65%40%64%6f%6d%61%69%6e%2e%63%6f%6d%3c%2f%61%3e
&lt;a href="mailto:me@example.com" class="email"&gt;me@example.com&lt;/a&gt; %27%29%3b'))</script>
&lt;script type="text/javascript" language="javascript"&gt; <a href="mailto:%6d%65@%64%6f%6d%61%69%6e.%63%6f%6d" >&#x6d;&#x65;&#x40;&#x64;&#x6f;&#x6d;&#x61;&#x69;&#x6e;&#x2e;&#x63;&#x6f;&#x6d;</a>
&lt;!-- <a href="mailto:me@example.com?subject=Hello%20to%20you%21" >me@example.com</a>
{document.write(String.fromCharCode(60,97,32,104,114,101,102,61,34,109,97,105,108,116,111,58,109,101,64,101,120,97,109,112,108,101,46,99,111,109,34,32,62,109,101,64,101,120,97,109,112,108,101,46,99,111,109,60,47,97,62))} <a href="mailto:me@example.com?cc=you@example.com%2Cthey@example.com" >me@example.com</a>
//--&gt; <a href="mailto:me@example.com" class="email">me@example.com</a>
&lt;/script&gt;</programlisting> <script type="text/javascript" language="javascript">
</example> <!--
{document.write(String.fromCharCode(60,97,32,104,114,101,102,61,34,109,97,105,108,116,111,58,109,101,64,101,120,97,109,112,108,101,46,99,111,109,34,32,62,109,101,64,101,120,97,109,112,108,101,46,99,111,109,60,47,97,62))}
//-->
</script>
]]>
</screen>
</example>
</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
sgml-omittag:t sgml-omittag:t
sgml-shorttag:t sgml-shorttag:t
sgml-minimize-attributes:nil sgml-minimize-attributes:nil
sgml-always-quote-attributes:t sgml-always-quote-attributes:t
sgml-indent-step:1 sgml-indent-step:1
sgml-indent-data:t sgml-indent-data:t
indent-tabs-mode:nil indent-tabs-mode:nil
sgml-parent-document:nil sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced" sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil sgml-exposed-tags:nil
sgml-local-catalogs:nil sgml-local-catalogs:nil
sgml-local-ecat-files:nil sgml-local-ecat-files:nil
End: End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->