mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14:27 +02:00
Moved description to top of page
This commit is contained in:
@@ -2,6 +2,12 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.assign">
|
||||
<title>{assign}</title>
|
||||
<para>
|
||||
{assign} is used for assigning template variables
|
||||
<emphasis role="bold">during the execution
|
||||
of the template</emphasis>.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -36,11 +42,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{assign} is used for assigning template variables
|
||||
<emphasis role="bold">during the execution
|
||||
of the template</emphasis>.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>{assign}</title>
|
||||
<programlisting>
|
||||
|
@@ -2,6 +2,20 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.counter">
|
||||
<title>{counter}</title>
|
||||
<para>
|
||||
{counter} is used to print out a count. {counter} will remember the
|
||||
count on each iteration. You can adjust the number, the interval
|
||||
and the direction of the count, as well as determine whether or not
|
||||
to print the value. You can run multiple counters concurrently by
|
||||
supplying a unique name for each one. If you do not supply a name,
|
||||
the name 'default' will be used.
|
||||
</para>
|
||||
<para>
|
||||
If you supply the special "assign" attribute, the output of the
|
||||
counter function will be assigned to this template variable instead of
|
||||
being output to the template.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -64,19 +78,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{counter} is used to print out a count. {counter} will remember the
|
||||
count on each iteration. You can adjust the number, the interval
|
||||
and the direction of the count, as well as determine whether or not
|
||||
to print the value. You can run multiple counters concurrently by
|
||||
supplying a unique name for each one. If you do not supply a name,
|
||||
the name 'default' will be used.
|
||||
</para>
|
||||
<para>
|
||||
If you supply the special "assign" attribute, the output of the
|
||||
counter function will be assigned to this template variable instead of
|
||||
being output to the template.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>counter</title>
|
||||
<programlisting>
|
||||
|
@@ -2,6 +2,12 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.cycle">
|
||||
<title>{cycle}</title>
|
||||
<para>
|
||||
{cycle} is used to cycle though a set of values. This makes it easy
|
||||
to alternate for example between two or more colors in a table, or cycle
|
||||
through an array of values.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -74,11 +80,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{cycle} is used to cycle though a set of values. This makes it easy
|
||||
to alternate for example between two or more colors in a table, or cycle
|
||||
through an array of values.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You can {cycle} through more than one set of values in your template
|
||||
by supplying a name attribute. Give each set of values a unique
|
||||
|
@@ -2,6 +2,17 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.eval">
|
||||
<title>{eval}</title>
|
||||
<para>
|
||||
{eval} is used to evaluate a variable as a template. This can be used
|
||||
for things like embedding template tags/variables into variables or
|
||||
tags/variables into config file variables.
|
||||
</para>
|
||||
<para>
|
||||
If you supply the special "assign" attribute, the output of the
|
||||
{eval} function will be assigned to this template variable instead of
|
||||
being output to the template.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -37,16 +48,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{eval} is used to evaluate a variable as a template. This can be used
|
||||
for things like embedding template tags/variables into variables or
|
||||
tags/variables into config file variables.
|
||||
</para>
|
||||
<para>
|
||||
If you supply the special "assign" attribute, the output of the
|
||||
{eval} function will be assigned to this template variable instead of
|
||||
being output to the template.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<title>Technical Note</title>
|
||||
<para>
|
||||
|
@@ -2,6 +2,20 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.fetch">
|
||||
<title>{fetch}</title>
|
||||
<para>
|
||||
{fetch} is used to fetch files from the local file system, http, or
|
||||
ftp and display the contents. If the file name begins with
|
||||
"http://", the web site page will be fetched and displayed. If the
|
||||
file name begins with "ftp://", the file will be fetched from the
|
||||
ftp server and displayed. For local files, the full system file
|
||||
path must be given, or a path relative to the executed php script.
|
||||
</para>
|
||||
<para>
|
||||
If you supply the special "assign" attribute, the output of the
|
||||
{fetch} function will be assigned to this template variable instead of
|
||||
being output to the template. (new in Smarty 1.5.0)
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -37,19 +51,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{fetch} is used to fetch files from the local file system, http, or
|
||||
ftp and display the contents. If the file name begins with
|
||||
"http://", the web site page will be fetched and displayed. If the
|
||||
file name begins with "ftp://", the file will be fetched from the
|
||||
ftp server and displayed. For local files, the full system file
|
||||
path must be given, or a path relative to the executed php script.
|
||||
</para>
|
||||
<para>
|
||||
If you supply the special "assign" attribute, the output of the
|
||||
{fetch} function will be assigned to this template variable instead of
|
||||
being output to the template. (new in Smarty 1.5.0)
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<title>Technical Note</title>
|
||||
<para>
|
||||
|
@@ -2,6 +2,16 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.checkboxes">
|
||||
<title>{html_checkboxes}</title>
|
||||
<para>
|
||||
{html_checkboxes} is a
|
||||
<link linkend="language.custom.functions">custom function</link>
|
||||
that creates an html checkbox
|
||||
group with provided data. It takes care of which item(s) are
|
||||
selected by default as well. Required attributes are values and
|
||||
output, unless you use options instead. All output is XHTML
|
||||
compatible.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -71,15 +81,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{html_checkboxes} is a
|
||||
<link linkend="language.custom.functions">custom function</link>
|
||||
that creates an html checkbox
|
||||
group with provided data. It takes care of which item(s) are
|
||||
selected by default as well. Required attributes are values and
|
||||
output, unless you use options instead. All output is XHTML
|
||||
compatible.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
All parameters that are not in the list above are printed as
|
||||
name/value-pairs inside each of the created <input>-tags.
|
||||
|
@@ -2,6 +2,14 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.image">
|
||||
<title>{html_image}</title>
|
||||
<para>
|
||||
{html_image} is a
|
||||
<link linkend="language.custom.functions">custom function</link>
|
||||
that generates an HTML tag for an
|
||||
image. The height and width are automatically calculated from the
|
||||
image file if none are supplied.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -64,13 +72,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{html_image} is a
|
||||
<link linkend="language.custom.functions">custom function</link>
|
||||
that generates an HTML tag for an
|
||||
image. The height and width are automatically calculated from the
|
||||
image file if none are supplied.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
basedir is the base directory that relative image paths are based
|
||||
from. If not given, the web server document root (
|
||||
|
@@ -2,6 +2,15 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.options">
|
||||
<title>{html_options}</title>
|
||||
<para>
|
||||
{html_options} is a
|
||||
<link linkend="language.custom.functions">custom function</link>
|
||||
that creates html <select><option> group
|
||||
with provided data. It takes care of which item(s) are selected by
|
||||
default as well. Required attributes are values and output, unless
|
||||
you use options instead.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -57,14 +66,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{html_options} is a
|
||||
<link linkend="language.custom.functions">custom function</link>
|
||||
that creates html <select><option> group
|
||||
with provided data. It takes care of which item(s) are selected by
|
||||
default as well. Required attributes are values and output, unless
|
||||
you use options instead.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
If a given value is an array, it will treat it as an html <optgroup>,
|
||||
and display the groups. Recursion is supported with <optgroup>. All
|
||||
|
@@ -2,6 +2,15 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.radios">
|
||||
<title>{html_radios}</title>
|
||||
<para>
|
||||
{html_radios} is a
|
||||
<link linkend="language.custom.functions">custom function</link>
|
||||
that creates html radio button
|
||||
group with provided data. It takes care of which item is selected
|
||||
by default as well. Required attributes are values and output,
|
||||
unless you use options instead. All output is XHTML compatible.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -64,14 +73,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{html_radios} is a
|
||||
<link linkend="language.custom.functions">custom function</link>
|
||||
that creates html radio button
|
||||
group with provided data. It takes care of which item is selected
|
||||
by default as well. Required attributes are values and output,
|
||||
unless you use options instead. All output is XHTML compatible.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
All parameters that are not in the list above are printed as
|
||||
name/value-pairs inside each of the created <input>-tags.
|
||||
|
@@ -2,6 +2,13 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.select.date">
|
||||
<title>{html_select_date}</title>
|
||||
<para>
|
||||
{html_select_date} is a
|
||||
<link linkend="language.custom.functions">custom function</link>
|
||||
that creates date dropdowns
|
||||
for you. It can display any or all of year, month, and day.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -221,12 +228,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{html_select_date} is a
|
||||
<link linkend="language.custom.functions">custom function</link>
|
||||
that creates date dropdowns
|
||||
for you. It can display any or all of year, month, and day.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>{html_select_date}</title>
|
||||
<para>Template code</para>
|
||||
|
@@ -2,6 +2,13 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.select.time">
|
||||
<title>{html_select_time}</title>
|
||||
<para>
|
||||
{html_select_time} is a
|
||||
<link linkend="language.custom.functions">custom function</link>
|
||||
that creates time dropdowns for you. It can display
|
||||
any or all of hour, minute, second and meridian.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -132,12 +139,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{html_select_time} is a
|
||||
<link linkend="language.custom.functions">custom function</link>
|
||||
that creates time dropdowns for you. It can display
|
||||
any or all of hour, minute, second and meridian.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The time-attribute can have different
|
||||
formats. It can be a unique timestamp, a
|
||||
|
@@ -2,6 +2,19 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.table">
|
||||
<title>{html_table}</title>
|
||||
<para>
|
||||
{html_table} is a
|
||||
<link linkend="language.custom.functions">custom function</link>
|
||||
that dumps an array of
|
||||
data into an HTML table. The <emphasis>cols</emphasis> attribute determines
|
||||
how many columns will be in the table. The <emphasis>table_attr</emphasis>,
|
||||
<emphasis>tr_attr</emphasis> and <emphasis>td_attr</emphasis> values
|
||||
determine the attributes given to the table, tr and td tags. If
|
||||
<emphasis>tr_attr</emphasis> or <emphasis>td_attr</emphasis> are arrays,
|
||||
they will be cycled through. <emphasis>trailpad</emphasis> is the value put
|
||||
into the trailing cells on the last table row if there are any present.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -116,18 +129,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{html_table} is a
|
||||
<link linkend="language.custom.functions">custom function</link>
|
||||
that dumps an array of
|
||||
data into an HTML table. The <emphasis>cols</emphasis> attribute determines
|
||||
how many columns will be in the table. The <emphasis>table_attr</emphasis>,
|
||||
<emphasis>tr_attr</emphasis> and <emphasis>td_attr</emphasis> values
|
||||
determine the attributes given to the table, tr and td tags. If
|
||||
<emphasis>tr_attr</emphasis> or <emphasis>td_attr</emphasis> are arrays,
|
||||
they will be cycled through. <emphasis>trailpad</emphasis> is the value put
|
||||
into the trailing cells on the last table row if there are any present.
|
||||
</para>
|
||||
|
||||
|
||||
<example>
|
||||
<title>html_table</title>
|
||||
|
@@ -2,6 +2,12 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.mailto">
|
||||
<title>{mailto}</title>
|
||||
<para>
|
||||
{mailto} automates the creation of mailto: links and optionally
|
||||
encodes them. Encoding e-mails makes it more difficult for
|
||||
web spiders to lift e-mail addresses off of your site.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -90,11 +96,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{mailto} automates the creation of mailto: links and optionally
|
||||
encodes them. Encoding e-mails makes it more difficult for
|
||||
web spiders to lift e-mail addresses off of your site.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<title>Technical Note</title>
|
||||
<para>
|
||||
|
@@ -2,6 +2,22 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.math">
|
||||
<title>{math}</title>
|
||||
<para>
|
||||
{math} allows the template designer to do math equations in the
|
||||
template. Any numeric template variables may be used in the
|
||||
equations, and the result is printed in place of the tag. The
|
||||
variables used in the equation are passed as parameters, which can
|
||||
be template variables or static values. +, -, /, *, abs, ceil, cos,
|
||||
exp, floor, log, log10, max, min, pi, pow, rand, round, sin, sqrt,
|
||||
srans and tan are all valid operators. Check the PHP documentation
|
||||
for further information on these math functions.
|
||||
</para>
|
||||
<para>
|
||||
If you supply the special "assign" attribute, the output of the
|
||||
math function will be assigned to this template variable instead of
|
||||
being output to the template.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -57,21 +73,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{math} allows the template designer to do math equations in the
|
||||
template. Any numeric template variables may be used in the
|
||||
equations, and the result is printed in place of the tag. The
|
||||
variables used in the equation are passed as parameters, which can
|
||||
be template variables or static values. +, -, /, *, abs, ceil, cos,
|
||||
exp, floor, log, log10, max, min, pi, pow, rand, round, sin, sqrt,
|
||||
srans and tan are all valid operators. Check the PHP documentation
|
||||
for further information on these math functions.
|
||||
</para>
|
||||
<para>
|
||||
If you supply the special "assign" attribute, the output of the
|
||||
math function will be assigned to this template variable instead of
|
||||
being output to the template.
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<title>Technical Note</title>
|
||||
<para>
|
||||
|
@@ -10,23 +10,20 @@
|
||||
help windows or tooltips.{popup_init} must be called once at the
|
||||
top of any page you plan on using the
|
||||
<link linkend="language.function.popup">{popup}</link> function.
|
||||
</para>
|
||||
<para>
|
||||
<ulink url="&url.overLib;">overLib</ulink>
|
||||
was written by Erik Bosrup, and the homepage is located at
|
||||
was written by Erik Bosrup, and the homepage/download is located at
|
||||
<ulink url="&url.overLib;">&url.overLib;</ulink>.
|
||||
</para>
|
||||
<para>
|
||||
As of Smarty version 2.1.2, overLib does NOT come with the release.
|
||||
Download overLib, place the 'overlib.js' file under your document
|
||||
root and supply the relative path to this file as the "src"
|
||||
parameter to {popup_init}.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>popup_init</title>
|
||||
<title>{popup_init}</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<head>
|
||||
{* popup_init must be called once at the top of the page *}
|
||||
{popup_init src="/javascripts/overlib.js"}
|
||||
{popup_init src="javascripts/overlib.js"}
|
||||
</head>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@@ -2,6 +2,12 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.popup">
|
||||
<title>{popup}</title>
|
||||
<para>
|
||||
{popup} is used to create javascript popup windows.
|
||||
<link linkend="language.function.popup.init">{popup_init}</link> MUST be called first for
|
||||
this to work.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -390,11 +396,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{popup} is used to create javascript popup windows.
|
||||
<link linkend="language.function.popup.init">{popup_init}</link> MUST be called first for
|
||||
this to work.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>{popup}</title>
|
||||
<programlisting>
|
||||
|
@@ -2,6 +2,18 @@
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.textformat">
|
||||
<title>{textformat}</title>
|
||||
<para>
|
||||
{textformat} is a
|
||||
<link linkend="plugins.block.functions">block function</link>
|
||||
used to format text. It basically
|
||||
cleans up spaces and special characters, and formats paragraphs by
|
||||
wrapping at a boundary and indenting lines.
|
||||
</para>
|
||||
<para>
|
||||
You can set the parameters explicitly, or use a preset style.
|
||||
Currently "email" is the only available style.
|
||||
</para>
|
||||
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
@@ -81,17 +93,7 @@
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
{textformat} is a
|
||||
<link linkend="plugins.block.functions">block function</link>
|
||||
used to format text. It basically
|
||||
cleans up spaces and special characters, and formats paragraphs by
|
||||
wrapping at a boundary and indenting lines.
|
||||
</para>
|
||||
<para>
|
||||
You can set the parameters explicitly, or use a preset style.
|
||||
Currently "email" is the only available style.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>{textformat}</title>
|
||||
<programlisting>
|
||||
|
Reference in New Issue
Block a user