mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
commit Peter Morgan's patch to add more references/aka see also
some WS
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
<para>
|
||||
There may be times when you want to print a default value for an empty
|
||||
variable instead of printing nothing, such as printing "&nbsp;" so that
|
||||
table backgrounds work properly. Many would use an {if} statement to
|
||||
table backgrounds work properly. Many would use an <link linkend="language.function.if">{if}</link> statement to
|
||||
handle this, but there is a shorthand way with Smarty, using the
|
||||
<emphasis>default</emphasis> variable modifier.
|
||||
</para>
|
||||
@@ -32,6 +32,7 @@
|
||||
]]>
|
||||
</programlisting>
|
||||
</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 id="tips.default.var.handling">
|
||||
@@ -54,6 +55,7 @@
|
||||
]]>
|
||||
</programlisting>
|
||||
</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 id="tips.passing.vars">
|
||||
<title>Passing variable title to header template</title>
|
||||
@@ -123,7 +125,7 @@ footer.tpl
|
||||
<note>
|
||||
<para>
|
||||
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>
|
||||
</note>
|
||||
<example>
|
||||
@@ -163,7 +165,7 @@ Jan 4, 2001
|
||||
</programlisting>
|
||||
</example>
|
||||
<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
|
||||
format. Here is a function to help you with that.
|
||||
</para>
|
||||
@@ -267,7 +269,7 @@ function insert_header($params)
|
||||
Traditionally, programming templates into your applications goes as
|
||||
follows: First, you accumulate your variables within your PHP
|
||||
application, (maybe with database queries.) Then, you instantiate your
|
||||
Smarty object, assign the variables and display the template. So lets
|
||||
Smarty object, <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
|
||||
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
|
||||
@@ -315,6 +317,7 @@ Stock Name: {$ticker.name} Stock Price: {$ticker.price}
|
||||
]]>
|
||||
</programlisting>
|
||||
</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 id="tips.obfuscating.email">
|
||||
<title>Obfuscating E-mail Addresses</title>
|
||||
@@ -343,6 +346,7 @@ Send inquiries to
|
||||
e-mail collector to decode these values, but not likely.
|
||||
</para>
|
||||
</note>
|
||||
<para>See also <link linkend="language.modifier.escape">escape</link></para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -28,6 +28,7 @@ PRACTICAL EXAMPLES:
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>See also <link linkend="language.modifier.escape">escape</link></para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -36,6 +36,8 @@ Many other combinations are allowed
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>See also <link linkend="language.variables.smarty">$smarty reserved variables</link>
|
||||
and <link linkend="language.config.variables">Config Variables</link></para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -127,7 +127,7 @@
|
||||
|
||||
<para>
|
||||
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>
|
||||
</sect1>
|
||||
|
||||
|
@@ -54,8 +54,10 @@
|
||||
</informaltable>
|
||||
<para>
|
||||
<emphasis>foreach</emphasis> loops are an alternative to
|
||||
<emphasis>section</emphasis> loops. <emphasis>foreach</emphasis> is
|
||||
used to loop over a single associative array. The syntax for
|
||||
<link
|
||||
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>section</emphasis>, but as a tradeoff it can only be used
|
||||
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
|
||||
will loop. This can be used inside or after the foreach.
|
||||
</para>
|
||||
<para>
|
||||
See also <link linkend="language.function.section">{section}</link> and
|
||||
<link linkend="language.variables.smarty.loops">$smarty.foreach</link>.
|
||||
</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
@@ -199,4 +205,4 @@
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
-->
|
||||
|
@@ -84,7 +84,7 @@
|
||||
<para>
|
||||
Use the syntax for <link
|
||||
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>
|
||||
<example>
|
||||
<title>function include template resource examples</title>
|
||||
@@ -101,6 +101,7 @@
|
||||
{* include from template resource named "db" *}
|
||||
{include file="db:header.tpl"}</programlisting>
|
||||
</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>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -17,6 +17,7 @@
|
||||
include("/path/to/display_weather.php");
|
||||
{/php}</programlisting>
|
||||
</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>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -1,247 +1,241 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.function.html.select.date">
|
||||
<title>html_select_date</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Attribute Name</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Required</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>prefix</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>Date_</entry>
|
||||
<entry>what to prefix the var name with</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>time</entry>
|
||||
<entry>timestamp/YYYY-MM-DD</entry>
|
||||
<entry>No</entry>
|
||||
<entry>current time in unix timestamp or YYYY-MM-DD
|
||||
format</entry>
|
||||
<entry>what date/time to use</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>start_year</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>current year</entry>
|
||||
<entry>the first year in the dropdown, either
|
||||
year number, or relative to current year (+/- N)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>end_year</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>same as start_year</entry>
|
||||
<entry>the last year in the dropdown, either
|
||||
year number, or relative to current year (+/- N)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_days</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>whether to display days or not</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_months</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>whether to display months or not</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_years</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>whether to display years or not</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>%B</entry>
|
||||
<entry>what format the month should be in (strftime)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>%02d</entry>
|
||||
<entry>what format the day output should be in (sprintf)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_value_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>%d</entry>
|
||||
<entry>what format the day value should be in (sprintf)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_as_text</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>false</entry>
|
||||
<entry>whether or not to display the year as text</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>reverse_years</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>false</entry>
|
||||
<entry>display years in reverse order</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_array</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>
|
||||
if a name is given, the select boxes will be drawn
|
||||
such that the results will be returned to PHP in the
|
||||
form of name[Day], name[Year], name[Month].
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_size</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adds size attribute to select tag if given</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_size</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adds size attribute to select tag if given</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_size</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adds size attribute to select tag if given</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>all_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adds extra attributes to all select/input tags if
|
||||
given</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adds extra attributes to select/input tags if
|
||||
given</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adds extra attributes to select/input tags if
|
||||
given</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adds extra attributes to select/input tags if
|
||||
given</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_order</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>MDY</entry>
|
||||
<entry>the order in which to display the fields</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_separator</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>\n</entry>
|
||||
<entry>string printed between different fields</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_value_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>%m</entry>
|
||||
<entry>strftime format of the month values, default is
|
||||
%m for month numbers.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_empty</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<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
|
||||
select-box read "Please select a year" for example.
|
||||
|
||||
Note that you can use values like "-MM-DD" as time-attribute to indicate
|
||||
an unselected year.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_empty</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>If supplied then the first element of the month's select-box has this
|
||||
value as it's label and "" as it's value. .
|
||||
Note that you can use values like "YYYY--DD" as time-attribute to indicate
|
||||
an unselected month.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_empty</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>If supplied then the first element of the day's select-box has this
|
||||
value as it's label and "" as it's value.
|
||||
Note that you can use values like "YYYY-MM-" as time-attribute to indicate
|
||||
an unselected day.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_select_date is a custom function that creates date dropdowns
|
||||
for you. It can display any or all of year, month, and day.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_select_date</title>
|
||||
<programlisting>
|
||||
<sect1 id="language.function.html.select.date">
|
||||
<title>html_select_date</title>
|
||||
<informaltable frame="all">
|
||||
<tgroup cols="5">
|
||||
<colspec colname="param" align="center" />
|
||||
<colspec colname="type" align="center" />
|
||||
<colspec colname="required" align="center" />
|
||||
<colspec colname="default" align="center" />
|
||||
<colspec colname="desc" />
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Attribute Name</entry>
|
||||
<entry>Type</entry>
|
||||
<entry>Required</entry>
|
||||
<entry>Default</entry>
|
||||
<entry>Description</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>prefix</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>Date_</entry>
|
||||
<entry>what to prefix the var name with</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>time</entry>
|
||||
<entry>timestamp/YYYY-MM-DD</entry>
|
||||
<entry>No</entry>
|
||||
<entry>current time in unix timestamp or YYYY-MM-DD format</entry>
|
||||
<entry>what date/time to use</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>start_year</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>current year</entry>
|
||||
<entry>the first year in the dropdown, either
|
||||
year number, or relative to current year (+/- N)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>end_year</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>same as start_year</entry>
|
||||
<entry>the last year in the dropdown, either
|
||||
year number, or relative to current year (+/- N)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_days</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>whether to display days or not</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_months</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>whether to display months or not</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>display_years</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>true</entry>
|
||||
<entry>whether to display years or not</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>%B</entry>
|
||||
<entry>what format the month should be in (strftime)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>%02d</entry>
|
||||
<entry>what format the day output should be in (sprintf)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_value_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>%d</entry>
|
||||
<entry>what format the day value should be in (sprintf)</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_as_text</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>false</entry>
|
||||
<entry>whether or not to display the year as text</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>reverse_years</entry>
|
||||
<entry>boolean</entry>
|
||||
<entry>No</entry>
|
||||
<entry>false</entry>
|
||||
<entry>display years in reverse order</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_array</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>
|
||||
if a name is given, the select boxes will be drawn
|
||||
such that the results will be returned to PHP in the
|
||||
form of name[Day], name[Year], name[Month].
|
||||
</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_size</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adds size attribute to select tag if given</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_size</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adds size attribute to select tag if given</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_size</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adds size attribute to select tag if given</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>all_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adds extra attributes to all select/input tags if given</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adds extra attributes to select/input tags if given</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adds extra attributes to select/input tags if given</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_extra</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>adds extra attributes to select/input tags if given</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_order</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>MDY</entry>
|
||||
<entry>the order in which to display the fields</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>field_separator</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>\n</entry>
|
||||
<entry>string printed between different fields</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_value_format</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>%m</entry>
|
||||
<entry>strftime format of the month values, default is
|
||||
%m for month numbers.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>year_empty</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<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
|
||||
select-box read "Please select a year" for example.
|
||||
Note that you can use values like "-MM-DD" as time-attribute to indicate
|
||||
an unselected year.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>month_empty</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>If supplied then the first element of the month's select-box has this
|
||||
value as it's label and "" as it's value. .
|
||||
Note that you can use values like "YYYY--DD" as time-attribute to indicate
|
||||
an unselected month.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>day_empty</entry>
|
||||
<entry>string</entry>
|
||||
<entry>No</entry>
|
||||
<entry>null</entry>
|
||||
<entry>If supplied then the first element of the day's select-box has this
|
||||
value as it's label and "" as it's value.
|
||||
Note that you can use values like "YYYY-MM-" as time-attribute to indicate
|
||||
an unselected day.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_select_date is a custom function that creates date dropdowns
|
||||
for you. It can display any or all of year, month, and day.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_select_date</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{html_select_date}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
This will output:
|
||||
</para>
|
||||
<screen>
|
||||
</programlisting>
|
||||
<para>
|
||||
This will output:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<select name="Date_Month">
|
||||
<option value="1">January</option>
|
||||
@@ -294,21 +288,21 @@ This will output:
|
||||
<option value="2001" selected="selected">2001</option>
|
||||
</select>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
<example>
|
||||
<title>html_select_date</title>
|
||||
<programlisting>
|
||||
<example>
|
||||
<title>html_select_date</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{* start and end year can be relative to current year *}
|
||||
{html_select_date prefix="StartDate" time=$time start_year="-5" end_year="+1" display_days=false}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
This will output: (current year is 2000)
|
||||
</para>
|
||||
<screen>
|
||||
</programlisting>
|
||||
<para>
|
||||
This will output: (current year is 2000)
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
<select name="StartDateMonth">
|
||||
<option value="1">January</option>
|
||||
@@ -334,9 +328,16 @@ This will output: (current year is 2000)
|
||||
<option value="2001">2001</option>
|
||||
</select>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</screen>
|
||||
</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>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
mode: sgml
|
||||
@@ -356,4 +357,4 @@ End:
|
||||
vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
-->
|
||||
|
@@ -67,8 +67,8 @@ Cold Wave Linked to Temperatures.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>See also <link linkend="language.modifier.count.paragraphs">count_paragraphs</link>
|
||||
<link linkend="language.modifier.count.sentences">count_sentences</link>
|
||||
<para>See also <link linkend="language.modifier.count.paragraphs">count_paragraphs</link>,
|
||||
<link linkend="language.modifier.count.sentences">count_sentences</link> and
|
||||
<link linkend="language.modifier.count.words">count_words</link>
|
||||
|
||||
</para>
|
||||
|
@@ -38,8 +38,8 @@ Man is Fatally Slain. Death Causes Loneliness, Feeling of Isolation.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>See also <link linkend="language.modifier.count.characters">count_characters</link>
|
||||
<link linkend="language.modifier.count.sentences">count_sentences</link>
|
||||
<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>
|
||||
|
||||
</para>
|
||||
|
@@ -37,8 +37,8 @@ Two Soviet Ships Collide - One Dies. Enraged Cow Injures Farmer with Axe.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>See also <link linkend="language.modifier.count.characters">count_characters</link>
|
||||
<link linkend="language.modifier.count.paragraphs">count_paragraphs</link>
|
||||
<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>
|
||||
|
||||
</para>
|
||||
|
@@ -37,8 +37,8 @@ Dealers Will Hear Car Talk at Noon.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>See also <link linkend="language.modifier.count.characters">count_characters</link>
|
||||
<link linkend="language.modifier.count.paragraphs">count_paragraphs</link>
|
||||
<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>
|
||||
|
@@ -37,9 +37,9 @@
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<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
|
||||
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
|
||||
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
|
||||
@@ -211,6 +211,7 @@ Monday, February 5, 2001
|
||||
</para>
|
||||
</note>
|
||||
</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>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -67,6 +67,8 @@ no title
|
||||
]]>
|
||||
</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></para>
|
||||
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -76,12 +76,12 @@ $smarty->display('index.tpl');
|
||||
'Stiff Opposition Expected to Casketless Funeral Plan'
|
||||
%27Stiff+Opposition+Expected+to+Casketless+Funeral+Plan%27
|
||||
\'Stiff Opposition Expected to Casketless Funeral Plan\'
|
||||
<a href="mailto:%62%6f%62%40%6d%65%2e%6e%65%74">bob@me.net</a>
|
||||
<a href="mailto:%62%6f%..snip..%65%74">bob..snip..et</a>
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<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>
|
||||
</sect1>
|
||||
|
||||
|
@@ -4,7 +4,7 @@
|
||||
<title>nl2br</title>
|
||||
<para>
|
||||
All linebreaks will be converted to <br /> tags in the given
|
||||
variable. This is equivalent to the PHP nl2br() function.
|
||||
variable. This is equivalent to the PHP <ulink url="&url.php-manual;nl2br">nl2br()</ulink> function.
|
||||
</para>
|
||||
<example>
|
||||
<title>nl2br</title>
|
||||
@@ -36,6 +36,7 @@ Sun or rain expected<br />today, dark tonight
|
||||
]]>
|
||||
</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></para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -108,6 +108,7 @@ years.
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<para>See also <link linkend="language.modifier.nl2br">nl2br</link></para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -87,8 +87,9 @@ rowBgColor = "#cccccc"
|
||||
<para>
|
||||
Config file variables cannot be used until
|
||||
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>See also <link linkend="language.syntax.variables">Variables</link> and <link linkend="language.variables.smarty">$smarty reserved variables</link></para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision$ -->
|
||||
<sect1 id="language.variables.smarty">
|
||||
<title>{$smarty} reserved variable</title>
|
||||
<title>{$smarty} reserved variables</title>
|
||||
<para>
|
||||
The reserved {$smarty} variable can be used to access several
|
||||
special template variables. The full list of them follows.
|
||||
@@ -56,7 +56,7 @@
|
||||
The current timestamp can be accessed with {$smarty.now}. The
|
||||
number reflects the number of seconds passed since the so-called
|
||||
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>
|
||||
<example>
|
||||
<title>using {$smarty.now}</title>
|
||||
@@ -137,6 +137,7 @@
|
||||
This variable is used for printing the right-delimiter value literally.
|
||||
See also <link linkend="language.function.ldelim">{ldelim},{rdelim}</link>.
|
||||
</para>
|
||||
<para>See also <link linkend="language.syntax.variables">Variables</link> and <link linkend="language.config.variables">Config Variables</link></para>
|
||||
</sect2>
|
||||
|
||||
</sect1>
|
||||
|
Reference in New Issue
Block a user