mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
updates by Peter Morgan:
more cross-linking better distinction between {assign} and assign() and {fetch} and fetch()
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
If a variable is used frequently throughout your templates, applying
|
||||
the default modifier every time it is mentioned can get a bit ugly. You
|
||||
can remedy this by assigning the variable its default value with the
|
||||
<link linkend="language.function.assign">assign</link> function.
|
||||
<link linkend="language.function.assign">{assign}</link> function.
|
||||
</para>
|
||||
<example>
|
||||
<title>Assigning a template variable its default value</title>
|
||||
@@ -118,7 +118,8 @@ footer.tpl
|
||||
archive example, we are using a variable from the archives_page.conf
|
||||
file instead of a hard coded variable. Also notice that "BC News" is
|
||||
printed if the $title variable is not set, using the
|
||||
<emphasis>default</emphasis> variable modifier.
|
||||
<link linkend="language.modifier.default">default</link>
|
||||
variable modifier.
|
||||
</para>
|
||||
</sect1>
|
||||
<sect1 id="tips.dates">
|
||||
@@ -208,7 +209,16 @@ function makeTimeStamp($year="", $month="", $day="")
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link linkend="language.function.html.select.date">{html_select_date}</link>,
|
||||
<link linkend="language.function.html.select.time">{html_select_time}</link>,
|
||||
<link linkend="language.modifier.date.format">date_format</link>
|
||||
and <link linkend="language.variables.smarty.now">$smarty.now</link>,
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<sect1 id="tips.wap">
|
||||
<title>WAP/WML</title>
|
||||
<para>
|
||||
|
@@ -47,12 +47,21 @@ Parse error: parse error in /path/to/smarty/templates_c/index.tpl.php on line 75
|
||||
When you encounter a PHP parsing error, the error line number will
|
||||
correspond to the compiled PHP script, not the template itself. Usually
|
||||
you can look at the template and spot the syntax error. Here are some
|
||||
common things to look for: missing close tags for {if}{/if} or
|
||||
{section}{/section}, or syntax of logic within an {if} tag. If you
|
||||
common things to look for: missing close tags for
|
||||
<link linkend="language.function.if">{if}{/if}</link> or
|
||||
<link linkend="language.function.if">{section}{/section}</link>,
|
||||
or syntax of logic within an {if} tag. If you
|
||||
can't find the error, you might have to open the compiled PHP file and
|
||||
go to the line number to figure out where the corresponding error is in
|
||||
the template.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="chapter.debugging.console">debugging</link>,
|
||||
<link linkend="variable.error.reporting">$error_reporting</link>
|
||||
and
|
||||
<link linkend="api.trigger.error">trigger_error()</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
</chapter>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -46,6 +46,13 @@
|
||||
fractions thereof.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="troubleshooting">troubleshooting</link>,
|
||||
<link linkend="variable.error.reporting">$error_reporting</link>
|
||||
and
|
||||
<link linkend="api.trigger.error">trigger_error()</link>.
|
||||
</para>
|
||||
</chapter>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -87,7 +87,9 @@
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
See also <link linkend="language.function.eval">{eval}</link>
|
||||
See also <link linkend="language.function.eval">{eval}</link>,
|
||||
<link linkend="language.function.fetch">{fetch}</link>,
|
||||
<link linkend="api.fetch">fetch()</link>
|
||||
and <link linkend="language.function.assign">{assign}</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
@@ -91,7 +91,8 @@
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Config files may also contain sections. You can load variables from
|
||||
<link linkend="config.files">Config Files</link>
|
||||
may also contain sections. You can load variables from
|
||||
within a section with the added attribute
|
||||
<emphasis>section</emphasis>.
|
||||
</para>
|
||||
@@ -126,8 +127,11 @@
|
||||
</example>
|
||||
|
||||
<para>
|
||||
See also <link linkend="config.files">Config Files</link> and
|
||||
<link linkend="language.config.variables">Config variables</link>.
|
||||
See also <link linkend="config.files">Config Files</link>,
|
||||
<link linkend="language.config.variables">Config variables</link>,
|
||||
<link linkend="api.get.config.vars">get_config_vars()</link>
|
||||
and
|
||||
<link linkend="api.config.load">config_load()</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
|
@@ -53,23 +53,24 @@
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
<emphasis>foreach</emphasis> loops are an alternative to
|
||||
<emphasis>{foreach}</emphasis> loops are an alternative to
|
||||
<link
|
||||
linkend="language.function.section"><emphasis>section</emphasis></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
|
||||
paired with <emphasis>/foreach</emphasis> tags. Required parameters
|
||||
<emphasis>{foreach}</emphasis> is much easier than
|
||||
<emphasis>{section}</emphasis>, but as a tradeoff it
|
||||
<emphasis role="bold">can only be used
|
||||
for a single array</emphasis>. <emphasis>{foreach}</emphasis> tags must be
|
||||
paired with <emphasis>{/foreach}</emphasis> tags. Required parameters
|
||||
are <emphasis>from</emphasis> and <emphasis>item</emphasis>. The
|
||||
name of the foreach loop can be anything you like, made up of
|
||||
letters, numbers and underscores. <emphasis>foreach</emphasis>
|
||||
loops can be nested, and the nested foreach names must be unique
|
||||
name of the {foreach} loop can be anything you like, made up of
|
||||
letters, numbers and underscores. <emphasis>{foreach}</emphasis>
|
||||
loops can be nested, and the nested {foreach} names must be unique
|
||||
from each other. The <emphasis>from</emphasis> variable (usually an
|
||||
array of values) determines the number of times
|
||||
<emphasis>foreach</emphasis> will loop.
|
||||
<emphasis>foreachelse</emphasis> is executed when there are no
|
||||
<emphasis>{foreach}</emphasis> will loop.
|
||||
<emphasis>{foreachelse}</emphasis> is executed when there are no
|
||||
values in the <emphasis>from</emphasis> variable.
|
||||
</para>
|
||||
<example>
|
||||
@@ -132,7 +133,9 @@
|
||||
|
||||
<para>
|
||||
Foreach-loops also have their own variables that handle foreach properties.
|
||||
These are indicated like so: {$smarty.foreach.foreachname.varname} with
|
||||
These are indicated like so:
|
||||
<link linkend="language.variables.smarty.loops">{$smarty.foreach.foreachname.varname}</link>
|
||||
with
|
||||
foreachname being the name specified as the <emphasis>name</emphasis>
|
||||
attribute of foreach
|
||||
</para>
|
||||
|
@@ -45,15 +45,15 @@
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
Include tags are used for including other templates in the current
|
||||
{include} tags are used for including other templates in the current
|
||||
template. Any variables available in the current template are also
|
||||
available within the included template. The include tag must have
|
||||
available within the included template. The {include} tag must have
|
||||
the attribute "file", which contains the template resource path.
|
||||
</para>
|
||||
<para>
|
||||
You can optionally pass the <emphasis>assign</emphasis> attribute,
|
||||
which will specify a template variable name that the output of
|
||||
<emphasis>include</emphasis> will be assigned to instead of
|
||||
{include} will be assigned to instead of
|
||||
displayed.
|
||||
</para>
|
||||
<example>
|
||||
@@ -90,7 +90,8 @@
|
||||
<para>
|
||||
Use the syntax for <link
|
||||
linkend="template.resources">template resources</link> to
|
||||
include files outside of the <link linkend="variable.template.dir">$template_dir</link> directory.
|
||||
include files outside of the <link linkend="variable.template.dir">$template_dir</link>
|
||||
directory.
|
||||
</para>
|
||||
<example>
|
||||
<title>function include template resource examples</title>
|
||||
@@ -138,3 +139,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<sect1 id="language.function.literal">
|
||||
<title>literal</title>
|
||||
<para>
|
||||
Literal tags allow a block of data to be taken literally. This is typically
|
||||
{literal} tags allow a block of data to be taken literally. This is typically
|
||||
used around javascript or stylesheet blocks where curly braces would
|
||||
interfere with the template delimiter syntax. Anything within
|
||||
{literal}{/literal} tags is not interpreted, but displayed as-is. If you
|
||||
|
@@ -3,7 +3,7 @@
|
||||
<sect1 id="language.function.php">
|
||||
<title>php</title>
|
||||
<para>
|
||||
php tags allow php to be embedded directly into the template. They
|
||||
{php} tags allow php to be embedded directly into the template. They
|
||||
will not be escaped, regardless of the <link
|
||||
linkend="variable.php.handling">$php_handling</link> setting. This
|
||||
is for advanced users only, not normally needed.
|
||||
@@ -22,6 +22,7 @@
|
||||
</example>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="variable.php.handling">$php_handling</link>,
|
||||
<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>.
|
||||
|
@@ -76,16 +76,16 @@
|
||||
</informaltable>
|
||||
<para>
|
||||
Template sections are used for looping over arrays of data. All
|
||||
<emphasis>section</emphasis> tags must be paired with
|
||||
<emphasis>/section</emphasis> tags. Required parameters are
|
||||
<emphasis>{section}</emphasis> tags must be paired with
|
||||
<emphasis>{/section}</emphasis> tags. Required parameters are
|
||||
<emphasis>name</emphasis> and <emphasis>loop</emphasis>. The name
|
||||
of the section can be anything you like, made up of letters,
|
||||
of the {section} can be anything you like, made up of letters,
|
||||
numbers and underscores. Sections can be nested, and the nested
|
||||
section names must be unique from each other. The loop variable
|
||||
(usually an array of values) determines the number of times the
|
||||
section will loop. When printing a variable within a section, the
|
||||
section name must be given next to variable name within brackets
|
||||
[]. <emphasis>sectionelse</emphasis> is
|
||||
[]. <emphasis>{sectionelse}</emphasis> is
|
||||
executed when there are no values in the loop variable.
|
||||
</para>
|
||||
<example>
|
||||
@@ -262,7 +262,8 @@
|
||||
</example>
|
||||
<para>
|
||||
Sections also have their own variables that handle section properties.
|
||||
These are indicated like so: {$smarty.section.sectionname.varname}
|
||||
These are indicated like so:
|
||||
<link linkend="language.variables.smarty.loops">{$smarty.section.sectionname.varname}</link>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
@@ -631,7 +632,7 @@
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
See also <link linkend="language.function.foreach">foreach</link>
|
||||
See also <link linkend="language.function.foreach">{foreach}</link>
|
||||
and <link linkend="language.variables.smarty.loops">$smarty.section</link>.
|
||||
</para>
|
||||
</sect2>
|
||||
|
@@ -38,7 +38,7 @@
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
fetch is used to fetch files from the local file system, http, or
|
||||
{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
|
||||
@@ -47,7 +47,7 @@
|
||||
</para>
|
||||
<para>
|
||||
If you supply the special "assign" attribute, the output of the
|
||||
fetch function will be assigned to this template variable instead of
|
||||
{fetch} function will be assigned to this template variable instead of
|
||||
being output to the template. (new in Smarty 1.5.0)
|
||||
</para>
|
||||
<note>
|
||||
@@ -88,7 +88,11 @@
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
See also <link linkend="api.fetch">api fetch()</link>.
|
||||
See also
|
||||
<link linkend="language.function.capture">{capture}</link>,
|
||||
<link linkend="language.function.eval">{eval}</link>
|
||||
and
|
||||
<link linkend="api.fetch">fetch()</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -222,7 +222,7 @@
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_select_date is a custom function that creates date dropdowns
|
||||
{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>
|
||||
@@ -331,7 +331,7 @@
|
||||
</screen>
|
||||
</example>
|
||||
<para>
|
||||
See also <link linkend="language.function.html.select.time">html_select_time</link>,
|
||||
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>.
|
||||
|
@@ -133,7 +133,7 @@
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
html_select_time is a custom function that
|
||||
{html_select_time} is a custom function that
|
||||
creates time dropdowns for you. It can display
|
||||
any or all of hour, minute, second and
|
||||
meridian.
|
||||
@@ -142,7 +142,8 @@
|
||||
The time-attribute can have different
|
||||
formats. It can be a unique timestamp or a
|
||||
string of the format YYYYMMDDHHMMSS or a string
|
||||
that is parseable by php's strtotime().
|
||||
that is parseable by php's
|
||||
<ulink url="&url.php-manual;strtotime">strtotime()</ulink>.
|
||||
</para>
|
||||
<example>
|
||||
<title>html_select_time</title>
|
||||
@@ -313,6 +314,12 @@
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<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:
|
||||
|
@@ -61,6 +61,14 @@
|
||||
declared trusted in the <link linkend="variable.security.settings">
|
||||
$security_settings['MODIFIER_FUNCS']</link>-array.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.register.modifier">register_modifier()</link>,
|
||||
<link linkend="api.register.function">register_function()</link>,
|
||||
<link linkend="plugins">Extending Smarty with plugins</link>
|
||||
and
|
||||
<link linkend="plugins.modifiers">modifiers</link>,
|
||||
</para>
|
||||
|
||||
&designers.language-modifiers.language-modifier-cat;
|
||||
&designers.language-modifiers.language-modifier-capitalize;
|
||||
|
@@ -37,9 +37,11 @@
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
<para>
|
||||
This formats a date and time into the given <ulink url="&url.php-manual;strftime">strftime()</ulink> 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 <ulink url="&url.php-manual;strtotime">strtotime</ulink>).
|
||||
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
|
||||
@@ -173,7 +175,8 @@ Monday, February 5, 2001
|
||||
%U - week number of the current year as a decimal number, starting with the first Sunday as the first day of the first week
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%V - The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current year, and with Monday as the first day of the week.
|
||||
%V - The ISO 8601:1988 week number of the current year as a decimal number, range 01 to 53, where week 1 is the first week that has at least 4 days in the current
|
||||
year, and with Monday as the first day of the week.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
%w - day of the week as a decimal, Sunday being 0
|
||||
@@ -238,3 +241,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
@@ -88,9 +88,11 @@
|
||||
<sect2 id="language.variables.smarty.capture">
|
||||
<title>{$smarty.capture}</title>
|
||||
<para>
|
||||
The output captured via <link linkend="language.function.capture">{capture}..{/capture}</link> construct can be
|
||||
The output captured via
|
||||
<link linkend="language.function.capture">{capture}..{/capture}</link>
|
||||
construct can be
|
||||
accessed using {$smarty} variable. See section on
|
||||
<link linkend="language.function.capture">capture</link> for an example.
|
||||
<link linkend="language.function.capture">{capture}</link> for an example.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
@@ -102,7 +104,7 @@
|
||||
linkend="language.config.variables">config variables</link>.
|
||||
{$smarty.config.foo} is a synonym for {#foo#}. See the section on
|
||||
<link
|
||||
linkend="language.function.config.load">config_load</link> for an example.
|
||||
linkend="language.function.config.load">{config_load}</link> for an example.
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
@@ -110,8 +112,8 @@
|
||||
<title>{$smarty.section}, {$smarty.foreach}</title>
|
||||
<para>
|
||||
{$smarty} variable can be used to refer to
|
||||
<link linkend="language.function.section">'section'</link> and
|
||||
<link linkend="language.function.foreach">'foreach'</link>
|
||||
<link linkend="language.function.section">{section}</link> and
|
||||
<link linkend="language.function.foreach">{foreach}</link>
|
||||
loop properties.
|
||||
</para>
|
||||
</sect2>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
keep template syntax to a minimum.
|
||||
</para>
|
||||
<para>
|
||||
If <link linkend="variable.security">security is enabled</link>,
|
||||
If <link linkend="variable.security">$security</link> is enabled,
|
||||
no private methods or functions can be accessed
|
||||
(begininning with "_"). If a method and property of the same name exist,
|
||||
the method will be used.
|
||||
@@ -44,7 +44,9 @@
|
||||
template
|
||||
(<literal>{foobar->meth2}...{/foobar->meth2}</literal>) and
|
||||
the parameters to the methods have the same synopsis as the
|
||||
parameters for block-function-plugins: They get 4 parameters
|
||||
parameters for
|
||||
<link linkend="plugins.block.functions">block-function-plugins</link>:
|
||||
They get 4 parameters
|
||||
<parameter>$params</parameter>,
|
||||
<parameter>$content</parameter>,
|
||||
<parameter>&$smarty</parameter> and
|
||||
@@ -117,3 +119,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
@@ -44,7 +44,7 @@ $smarty->assign_by_ref('Address', $address);
|
||||
See also <link linkend="api.assign">assign()</link>,
|
||||
<link linkend="api.clear.all.assign">clear_all_assign()</link>,
|
||||
<link linkend="api.append">append()</link>
|
||||
and <link linkend="language.function.assign">{assign} function</link>
|
||||
and <link linkend="language.function.assign">{assign}</link>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
@@ -40,7 +40,7 @@ $smarty->assign(array('city' => 'Lincoln', 'state' => 'Nebraska'));
|
||||
See also <link linkend="api.assign.by.ref">assign_by_ref()</link>,
|
||||
<link linkend="api.clear.assign">clear_assign()</link>,
|
||||
<link linkend="api.append">append()</link>,
|
||||
<link linkend="language.function.assign">{assign}</link>.
|
||||
<link linkend="language.function.assign">{assign}</link>,
|
||||
and
|
||||
<link linkend="api.get.template.vars">get_template_vars()</link>
|
||||
</para>
|
||||
|
@@ -35,13 +35,11 @@ print_r($config_vars);
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.clear.config">clear_config()</link>,
|
||||
<link linkend="language.function.config.load">{config_load}</link>
|
||||
<link linkend="language.function.config.load">{config_load}</link>,
|
||||
<link linkend="api.config.load">config_load()</link>
|
||||
and
|
||||
<link linkend="api.config.load">config_load()</link>,
|
||||
|
||||
|
||||
<link linkend="api.get.template.vars">get_template_vars()</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -32,6 +32,14 @@ print_r($tpl_vars);
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
See also <link linkend="api.assign">assign()</link>,
|
||||
<link linkend="language.function.assign">{assign}</link>,
|
||||
<link linkend="api.clear.assign">clear_assign()</link>
|
||||
and
|
||||
<link linkend="api.get.config.vars">get_config_vars()</link>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -43,6 +43,16 @@ $smarty->register_modifier("sslash", "stripslashes");
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.unregister.modifier">unregister_modifier()</link>,
|
||||
<link linkend="api.register.function">register_function()</link>,
|
||||
<link linkend="language.modifiers">modifiers</link>,
|
||||
|
||||
<link linkend="plugins">Extending Smarty with plugins</link>
|
||||
and
|
||||
<link linkend="plugins.modifiers">Plugin modifiers</link>,
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -21,7 +21,7 @@
|
||||
of the manual for examples.
|
||||
</para>
|
||||
<para>
|
||||
See Also <link linkend="api.unregister.object">unregister_object</link>.
|
||||
See Also <link linkend="api.unregister.object">unregister_object()</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@@ -16,6 +16,14 @@
|
||||
accept either a path to the template on the filesystem or a
|
||||
resource string specifying the template.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.display">display()</link>,
|
||||
<link linkend="api.fetch">fetch()</link>,
|
||||
<link linkend="language.function.include">{include}</link>
|
||||
and
|
||||
<link linkend="language.function.insert">{insert}</link>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -15,8 +15,17 @@
|
||||
<para>
|
||||
This function can be used to output an error message using Smarty.
|
||||
<parameter>level</parameter> parameter can be one of the values
|
||||
used for trigger_error() PHP function, i.e. E_USER_NOTICE,
|
||||
used for
|
||||
<ulink url="&url.php-manual;trigger_error">trigger_error()</ulink>
|
||||
PHP function, i.e. E_USER_NOTICE,
|
||||
E_USER_WARNING, etc. By default it's E_USER_WARNING.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="variable.error.reporting">$error_reporting</link>,
|
||||
<link linkend="chapter.debugging.console">debugging</link>
|
||||
and
|
||||
<link linkend="smarty.php.errors">Troubleshooting</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@@ -11,9 +11,13 @@
|
||||
Smarty to use the current
|
||||
<link linkend="variable.cache.lifetime">$cache_lifetime</link>
|
||||
variable to determine if the
|
||||
cache has expired. A value of 2 tells Smarty to use the cache_lifetime
|
||||
cache has expired. A value of 2 tells Smarty to use the
|
||||
<link linkend="variable.cache.lifetime">$cache_lifetime</link>
|
||||
value at the time the cache was generated. This way you can set the
|
||||
cache_lifetime just before fetching the template to have granular
|
||||
<link linkend="variable.cache.lifetime">$cache_lifetime</link>
|
||||
just before
|
||||
<link linkend="api.fetch">fetching</link>
|
||||
the template to have granular
|
||||
control over when that particular cache expires.
|
||||
See also <link linkend="api.is.cached">is_cached()</link>.
|
||||
</para>
|
||||
|
@@ -6,7 +6,8 @@
|
||||
This is the name of the directory where compiled templates are
|
||||
located. By default this is "./templates_c", meaning that it
|
||||
will look for the compile directory in the same directory as
|
||||
the executing php script.
|
||||
the executing php script. <emphasis role="bold">This directory must
|
||||
be writeable by the web server.</emphasis>
|
||||
</para>
|
||||
<note>
|
||||
<title>Technical Note</title>
|
||||
@@ -22,6 +23,9 @@
|
||||
the web server document root.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <link linkend="variable.compile.id">$compile_id</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -13,7 +13,7 @@
|
||||
See also
|
||||
<link linkend="language.function.debug">{debug}</link>,
|
||||
<link linkend="variable.debug.tpl">$debug_tpl</link>,
|
||||
and <link linkend="variable.debugging.ctrl">$debuging_ctrl</link>
|
||||
and <link linkend="variable.debugging.ctrl">$debugging_ctrl</link>
|
||||
</para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -10,6 +10,13 @@
|
||||
linkend="chapter.debugging.console">debugging</link> is enabled this value
|
||||
is ignored and the error-level is left untouched.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.trigger.error">trigger_error()</link>,
|
||||
<link linkend="chapter.debugging.console">debugging</link>
|
||||
and
|
||||
<link linkend="troubleshooting">Troubleshooting</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -7,7 +7,10 @@
|
||||
Default is "{".
|
||||
</para>
|
||||
<para>
|
||||
See also <link linkend="variable.right.delimiter">$right_delimiter</link>.
|
||||
See also <link linkend="variable.right.delimiter">$right_delimiter</link>
|
||||
and
|
||||
<link linkend="language.escaping">escaping smarty parsing</link>
|
||||
.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
|
@@ -7,7 +7,9 @@
|
||||
Default is "}".
|
||||
</para>
|
||||
<para>
|
||||
See also <link linkend="variable.left.delimiter">$left_delimiter</link>.
|
||||
See also <link linkend="variable.left.delimiter">$left_delimiter</link>
|
||||
and
|
||||
<link linkend="language.escaping">escaping smarty parsing</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
|
||||
|
@@ -10,9 +10,17 @@
|
||||
<note>
|
||||
<title>Technical Note</title>
|
||||
<para>
|
||||
Since Smarty-2.6.2 <varname>use_sub_dirs</varname> defaults to false.
|
||||
Since Smarty-2.6.2 <varname>$use_sub_dirs</varname> defaults to false.
|
||||
</para>
|
||||
</note>
|
||||
<para>
|
||||
See also <link linkend="variable.template.dir">$template_dir</link>,
|
||||
<link linkend="variable.compile.dir">$compile_dir</link>,
|
||||
<link linkend="variable.config.dir">$config_dir</link>,
|
||||
<link linkend="variable.plugins.dir">$plugins_dir</link>
|
||||
and
|
||||
<link linkend="variable.cache.dir">$cache_dir</link>.
|
||||
</para>
|
||||
</sect1>
|
||||
<!-- Keep this comment at the end of the file
|
||||
Local variables:
|
||||
|
@@ -3,8 +3,10 @@
|
||||
<sect1 id="caching.multiple.caches">
|
||||
<title>Multiple Caches Per Page</title>
|
||||
<para>
|
||||
You can have multiple cache files for a single call to display() or
|
||||
fetch(). Let's say that a call to display('index.tpl') may have several
|
||||
You can have multiple cache files for a single call to
|
||||
<link linkend="api.display">display()</link>
|
||||
or <link linkend="api.fetch">fetch()</link>.
|
||||
Let's say that a call to display('index.tpl') may have several
|
||||
different output contents depending on some condition, and you want
|
||||
separate caches for each one. You can do this by passing a cache_id as the
|
||||
second parameter to the function call.
|
||||
@@ -27,7 +29,9 @@ $smarty->display('index.tpl',$my_cache_id);
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
Above, we are passing the variable $my_cache_id to display() as the
|
||||
Above, we are passing the variable $my_cache_id to
|
||||
<link linkend="api.display">display()</link>
|
||||
as the
|
||||
cache_id. For each unique value of $my_cache_id, a separate cache will be
|
||||
generated for index.tpl. In this example, "article_id" was passed in the
|
||||
URL and is used as the cache_id.
|
||||
@@ -77,7 +81,8 @@ $smarty->display('index.tpl',$my_cache_id);
|
||||
</example>
|
||||
<para>
|
||||
You can clear all caches for a particular cache_id by passing null as the
|
||||
first parameter to clear_cache().
|
||||
first parameter to
|
||||
<link linkend="api.clear.cache">clear_cache()</link>.
|
||||
</para>
|
||||
<example>
|
||||
<title>clearing all caches for a particular cache_id</title>
|
||||
|
Reference in New Issue
Block a user