mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-07 17:54:38 +02:00
more linking and WS from Peter
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.append.by.ref">
|
||||
<refnamediv>
|
||||
<refname>append_by_ref</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>append_by_ref()</refname>
|
||||
<refpurpose>append values by reference</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>append_by_ref</methodname>
|
||||
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
|
||||
|
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.append">
|
||||
<refnamediv>
|
||||
<refname>append</refname>
|
||||
<refpurpose></refpurpose>
|
||||
</refnamediv>
|
||||
<refname>append()</refname>
|
||||
<refpurpose>append an element to an assigned array</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>append</methodname>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
@@ -18,7 +18,7 @@
|
||||
<methodparam choice="opt"><type>bool</type><parameter>merge</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This is used to append an element to an assigned array. If you append
|
||||
If you append
|
||||
to a string value, it is converted to an array value and then
|
||||
appended to. You can explicitly pass name/value pairs, or associative
|
||||
arrays containing the name/value pairs. If you pass the optional third
|
||||
|
@@ -2,18 +2,19 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.assign.by.ref">
|
||||
<refnamediv>
|
||||
<refname>assign_by_ref</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>assign_by_ref()</refname>
|
||||
<refpurpose>assign values by reference</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>assign_by_ref</methodname>
|
||||
<methodparam><type>string</type><parameter>varname</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This is used to assign values to the templates by reference instead of
|
||||
This is used to <link linkend="api.assign">assign()</link>
|
||||
values to the templates by reference instead of
|
||||
making a copy. See the PHP manual on variable referencing for an explanation.
|
||||
</para>
|
||||
<note>
|
||||
@@ -29,7 +30,7 @@
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>assign_by_ref</title>
|
||||
<title>assign_by_ref()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.assign">
|
||||
<refnamediv>
|
||||
<refname>assign</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>assign()</refname>
|
||||
<refpurpose>assign values to the templates</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>assign</methodname>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
@@ -17,13 +17,12 @@
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This is used to assign values to the templates. You can
|
||||
explicitly pass name/value pairs, or associative arrays
|
||||
You can explicitly pass name/value pairs, or associative arrays
|
||||
containing the name/value pairs.
|
||||
</para>
|
||||
<example>
|
||||
<title>assign</title>
|
||||
<programlisting role="php">
|
||||
<title>assign()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// passing name/value pairs
|
||||
@@ -32,17 +31,42 @@ $smarty->assign('Address', $address);
|
||||
|
||||
// passing an associative array
|
||||
$smarty->assign(array('city' => 'Lincoln', 'state' => 'Nebraska'));
|
||||
|
||||
// passing a row from a database (eg adodb)
|
||||
$sql = 'select id, name, email from contacts where contact ='.$id;
|
||||
$smarty->assign('contact', $db->getRow($sql));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</programlisting>
|
||||
<para>
|
||||
Access these in the template with
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{$Name}
|
||||
{$Address}
|
||||
{$city}
|
||||
{$state}
|
||||
|
||||
{$contact.id}, {$contact.name},{$contact.email}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
For more complex array assignments see
|
||||
<link linkend="language.function.foreach">{foreach}</link>
|
||||
and
|
||||
<link linkend="language.function.section">{section}</link>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See also <link linkend="api.assign.by.ref">assign_by_ref()</link>,
|
||||
<link linkend="api.get.template.vars">get_template_vars()</link>,
|
||||
<link linkend="api.clear.assign">clear_assign()</link>,
|
||||
<link linkend="api.append">append()</link>,
|
||||
<link linkend="language.function.assign">{assign}</link>,
|
||||
<link linkend="api.append">append()</link>
|
||||
and
|
||||
<link linkend="api.get.template.vars">get_template_vars()</link>
|
||||
<link linkend="language.function.assign">{assign}</link>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
|
@@ -2,25 +2,33 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.all.assign">
|
||||
<refnamediv>
|
||||
<refname>clear_all_assign</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>clear_all_assign()</refname>
|
||||
<refpurpose>clears the values of all assigned variables</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_all_assign</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This clears the values of all assigned variables.
|
||||
</para>
|
||||
<example>
|
||||
<title>clear_all_assign</title>
|
||||
<title>clear_all_assign()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// passing name/value pairs
|
||||
$smarty->assign('Name', 'Fred');
|
||||
$smarty->assign('Address', $address);
|
||||
|
||||
// will output above
|
||||
print_r( $smarty->get_template_vars() );
|
||||
|
||||
// clear all assigned variables
|
||||
$smarty->clear_all_assign();
|
||||
|
||||
// will output nothing
|
||||
print_r( $smarty->get_template_vars() );
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
@@ -2,17 +2,17 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.all.cache">
|
||||
<refnamediv>
|
||||
<refname>clear_all_cache</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>clear_all_cache()</refname>
|
||||
<refpurpose>clears the entire template cache</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_all_cache</methodname>
|
||||
<methodparam choice="opt"><type>int</type><parameter>expire_time</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This clears the entire template cache. As an optional
|
||||
As an optional
|
||||
parameter, you can supply a minimum age in seconds the cache
|
||||
files must be before they will get cleared.
|
||||
</para>
|
||||
@@ -29,7 +29,8 @@ $smarty->clear_all_cache();
|
||||
</example>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.clear.cache">clear_cache()</link>
|
||||
<link linkend="api.clear.cache">clear_cache()</link>,
|
||||
<link linkend="api.is.cached">is_cached()</link>
|
||||
and
|
||||
<link linkend="caching">caching</link>
|
||||
</para>
|
||||
|
@@ -2,29 +2,28 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.assign">
|
||||
<refnamediv>
|
||||
<refname>clear_assign</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>clear_assign()</refname>
|
||||
<refpurpose>clears the value of an assigned variable</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_assign</methodname>
|
||||
<methodparam><type>mixed</type><parameter>var</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This clears the value of an assigned variable. This
|
||||
can be a single value, or an array of values.
|
||||
This can be a single value, or an array of values.
|
||||
</para>
|
||||
<example>
|
||||
<title>clear_assign</title>
|
||||
<title>clear_assign()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// clear a single variable
|
||||
$smarty->clear_assign("Name");
|
||||
$smarty->clear_assign('Name');
|
||||
|
||||
// clear multiple variables
|
||||
$smarty->clear_assign(array("Name", "Address", "Zip"));
|
||||
// clears multiple variables
|
||||
$smarty->clear_assign(array('Name', 'Address', 'Zip'));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
@@ -33,6 +32,7 @@ $smarty->clear_assign(array("Name", "Address", "Zip"));
|
||||
See also
|
||||
<link linkend="api.clear.all.assign">clear_all_assign()</link>,
|
||||
<link linkend="api.clear.config">clear_config()</link>,
|
||||
<link linkend="api.get.template.vars">get_template_vars()</link>,
|
||||
<link linkend="api.assign">assign()</link>
|
||||
and <link linkend="api.append">append()</link>
|
||||
</para>
|
||||
|
@@ -2,46 +2,52 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.cache">
|
||||
<refnamediv>
|
||||
<refname>clear_cache</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>clear_cache()</refname>
|
||||
<refpurpose>clears the cache for a specific template</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_cache</methodname>
|
||||
<methodparam><type>string</type><parameter>template</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter>
|
||||
</methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>expire_time</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This clears the cache for a specific <parameter>template</parameter>.
|
||||
If you have multiple caches for this template, you can clear a specific
|
||||
cache by supplying the <parameter>cache_id</parameter> as the second
|
||||
parameter.
|
||||
You can also pass a <parameter>compile_id</parameter> as a third parameter.
|
||||
You can "group" templates together so they can be removed as a group. See the
|
||||
If you have <link linkend="caching.multiple.caches">multiple caches</link>
|
||||
for a template, you can clear a specific
|
||||
cache by supplying the <parameter>cache_id</parameter> as the second
|
||||
parameter.
|
||||
You can also pass a
|
||||
<link linkend="variable.compile.id"><parameter>$compile_id</parameter></link>
|
||||
as a third parameter.
|
||||
You can <link linkend="caching.groups">"group"</link> templates
|
||||
together so they can be removed as a group. See the
|
||||
<link linkend="caching">caching section</link> for more
|
||||
information. As an optional fourth parameter, you can supply a
|
||||
minimum age in seconds the cache file must be before it will
|
||||
get cleared.
|
||||
</para>
|
||||
<example>
|
||||
<title>clear_cache</title>
|
||||
<title>clear_cache()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// clear the cache for a template
|
||||
$smarty->clear_cache("index.tpl");
|
||||
$smarty->clear_cache('index.tpl');
|
||||
|
||||
// clear the cache for a particular cache id in an multiple-cache template
|
||||
$smarty->clear_cache("index.tpl", "CACHEID");
|
||||
$smarty->clear_cache('index.tpl', 'CACHEID');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.clear.all.cache">clear_all_cache()</link>
|
||||
and
|
||||
<link linkend="caching">caching</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
@@ -66,3 +72,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
@@ -2,28 +2,31 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.compiled.tpl">
|
||||
<refnamediv>
|
||||
<refname>clear_compiled_tpl</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>clear_compiled_tpl()</refname>
|
||||
<refpurpose>clears the compiled version of the specified template resource</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_compiled_tpl</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>tpl_file</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter>
|
||||
</methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>exp_time</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This clears the compiled version of the specified template
|
||||
resource, or all compiled template files if one is not specified.
|
||||
if you pass a compile_id only the compiled template for this
|
||||
specific compile_id is cleared. if you pass an exp_time, then only
|
||||
If you pass a <link linkend="variable.compile.id">$compile_id</link>
|
||||
only the compiled template for this
|
||||
specific <link linkend="variable.compile.id">$compile_id</link>
|
||||
is cleared. if you pass an exp_time, then only
|
||||
compiled templates older than exp_time seconds are cleared, by
|
||||
default all compiled templates are cleared regardless of their age.
|
||||
This function is for advanced use only, not normally needed.
|
||||
</para>
|
||||
<example>
|
||||
<title>clear_compiled_tpl</title>
|
||||
<title>clear_compiled_tpl()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -58,3 +61,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.clear.config">
|
||||
<refnamediv>
|
||||
<refname>clear_config</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>clear_config()</refname>
|
||||
<refpurpose>clears assigned config variables</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>clear_config</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>var</parameter></methodparam>
|
||||
@@ -18,7 +18,7 @@
|
||||
supplied, only that variable is cleared.
|
||||
</para>
|
||||
<example>
|
||||
<title>clear_config</title>
|
||||
<title>clear_config()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -33,6 +33,7 @@ $smarty->clear_config('foobar');
|
||||
</example>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.get.config.vars">get_config_vars()</link>,
|
||||
<link linkend="language.config.variables">config variables</link>,
|
||||
<link linkend="config.files">config files</link>,
|
||||
<link linkend="language.function.config.load">{config_load}</link>,
|
||||
|
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.config.load">
|
||||
<refnamediv>
|
||||
<refname>config_load</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>config_load()</refname>
|
||||
<refpurpose> loads config file data and assigns it to the template</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>config_load</methodname>
|
||||
<methodparam><type>string</type><parameter>file</parameter></methodparam>
|
||||
@@ -35,7 +35,7 @@
|
||||
</para>
|
||||
</note>
|
||||
<example>
|
||||
<title>config_load</title>
|
||||
<title>config_load()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -51,6 +51,7 @@ $smarty->config_load('my.conf', 'foobar');
|
||||
<para>
|
||||
See also
|
||||
<link linkend="language.function.config.load">{config_load}</link>,
|
||||
<link linkend="api.get.config.vars">get_config_vars()</link>,
|
||||
<link linkend="api.clear.config">clear_config()</link>,
|
||||
and
|
||||
<link linkend="language.config.variables">config variables</link>
|
||||
|
@@ -2,19 +2,22 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.display">
|
||||
<refnamediv>
|
||||
<refname>display</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>display()</refname>
|
||||
<refpurpose>displays the template</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>display</methodname>
|
||||
<methodparam><type>string</type><parameter>template</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter>
|
||||
</methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This displays the template. Supply a valid <link
|
||||
This displays the template unlike
|
||||
<link linkend="api.fetch">fetch()</link>.
|
||||
Supply a valid <link
|
||||
linkend="template.resources">template resource</link>
|
||||
type and path. As an optional second parameter, you can pass a
|
||||
$cache id.
|
||||
@@ -23,7 +26,7 @@
|
||||
</para>
|
||||
¶meter.compileid;
|
||||
<example>
|
||||
<title>display</title>
|
||||
<title>display()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -57,24 +60,25 @@ $smarty->display("index.tpl");
|
||||
<para>
|
||||
Use the syntax for <link
|
||||
linkend="template.resources">template resources</link> to
|
||||
display files outside of the $template_dir directory.
|
||||
display files outside of the
|
||||
<link linkend="variable.template.dir">$template_dir</link> directory.
|
||||
</para>
|
||||
<example>
|
||||
<title>function display template resource examples</title>
|
||||
<title>function display() template resource examples</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// absolute filepath
|
||||
$smarty->display("/usr/local/include/templates/header.tpl");
|
||||
$smarty->display('/usr/local/include/templates/header.tpl');
|
||||
|
||||
// absolute filepath (same thing)
|
||||
$smarty->display("file:/usr/local/include/templates/header.tpl");
|
||||
$smarty->display('file:/usr/local/include/templates/header.tpl');
|
||||
|
||||
// windows absolute filepath (MUST use "file:" prefix)
|
||||
$smarty->display("file:C:/www/pub/templates/header.tpl");
|
||||
$smarty->display('file:C:/www/pub/templates/header.tpl');
|
||||
|
||||
// include from template resource named "db"
|
||||
$smarty->display("db:header.tpl");
|
||||
$smarty->display('db:header.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
@@ -106,3 +110,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
@@ -2,19 +2,21 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.fetch">
|
||||
<refnamediv>
|
||||
<refname>fetch</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>fetch()</refname>
|
||||
<refpurpose>returns the template output</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>string</type><methodname>fetch</methodname>
|
||||
<methodparam><type>string</type><parameter>template</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>$compile_id</parameter>
|
||||
</methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This returns the template output instead of displaying it.
|
||||
This returns the template output instead of
|
||||
<link linkend="api.display">displaying</link> it.
|
||||
Supply a valid <link
|
||||
linkend="template.resources">template resource</link>
|
||||
type and path. As an optional second parameter, you can pass a
|
||||
@@ -22,45 +24,101 @@
|
||||
section</link> for more information.
|
||||
</para>
|
||||
¶meter.compileid;
|
||||
<para>
|
||||
<example>
|
||||
<title>fetch</title>
|
||||
<programlisting role="php">
|
||||
|
||||
<para>
|
||||
<example>
|
||||
<title>fetch()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
include("Smarty.class.php");
|
||||
include('Smarty.class.php');
|
||||
$smarty = new Smarty;
|
||||
|
||||
$smarty->caching = true;
|
||||
|
||||
// only do db calls if cache doesn't exist
|
||||
if(!$smarty->is_cached("index.tpl")) {
|
||||
if(!$smarty->is_cached('index.tpl')) {
|
||||
|
||||
// dummy up some data
|
||||
$address = "245 N 50th";
|
||||
$address = '245 N 50th';
|
||||
$db_data = array(
|
||||
"City" => "Lincoln",
|
||||
"State" => "Nebraska",
|
||||
"Zip" => "68502"
|
||||
'City' => 'Lincoln',
|
||||
'State' => 'Nebraska',
|
||||
'Zip' => '68502'
|
||||
);
|
||||
|
||||
$smarty->assign("Name","Fred");
|
||||
$smarty->assign("Address",$address);
|
||||
$smarty->assign('Name','Fred');
|
||||
$smarty->assign('Address',$address);
|
||||
$smarty->assign($db_data);
|
||||
|
||||
}
|
||||
|
||||
// capture the output
|
||||
$output = $smarty->fetch("index.tpl");
|
||||
$output = $smarty->fetch('index.tpl');
|
||||
|
||||
// do something with $output here
|
||||
|
||||
echo $output;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<example>
|
||||
<title>Using fetch() to send an email</title>
|
||||
<para>
|
||||
The email_body.txt template
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
Dear {$contact.name},
|
||||
|
||||
Welcome and thankyou for signing up as a member of our user group,
|
||||
|
||||
Click on the link below to login with your user name of '{$contact.login_id}'
|
||||
so you can post in our forums.
|
||||
|
||||
http://{$smarty.server.SERVER_NAME}/index.php?page=login
|
||||
|
||||
List master
|
||||
Some user group
|
||||
|
||||
{include file="email_disclaimer.txt"}
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
The email_disclaimer.txt template
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
This e-mail is intended for the addressee shown. It contains information
|
||||
....... etc .......
|
||||
]]>
|
||||
</programlisting>
|
||||
<para>
|
||||
and the php script using the PHP
|
||||
<ulink url="&url.php-manual;function.mail">mail()</ulink> function
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// get contact from database eg using pear or adodb
|
||||
$query = 'select name, email, login_id from contacts where contact_id='.$contact_id;
|
||||
$contact = $db->getRow($sql);
|
||||
$smarty->assign('contact', $contact);
|
||||
|
||||
mail($contact['email'], 'Subject', $smarty->fetch('email_body.txt'));
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link linkend="language.function.fetch">{fetch}</link>
|
||||
@@ -92,3 +150,5 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
||||
|
@@ -2,24 +2,26 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.get.config.vars">
|
||||
<refnamediv>
|
||||
<refname>get_config_vars</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>get_config_vars()</refname>
|
||||
<refpurpose>returns the given loaded config variable value</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>get_config_vars</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>varname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This returns the given loaded config variable value. If no parameter
|
||||
is given, an array of all loaded config variables is returned.
|
||||
If no parameter is given, an array of all loaded
|
||||
<link linkend="language.config.variables">config variables</link>
|
||||
is returned.
|
||||
</para>
|
||||
<example>
|
||||
<title>get_config_vars</title>
|
||||
<title>get_config_vars()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// get loaded config template var 'foo'
|
||||
$foo = $smarty->get_config_vars('foo');
|
||||
|
||||
|
@@ -2,26 +2,27 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.get.registered.object">
|
||||
<refnamediv>
|
||||
<refname>get_registered_object</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>get_registered_object()</refname>
|
||||
<refpurpose>returns a reference to a registered object</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>get_registered_object</methodname>
|
||||
<methodparam><type>string</type><parameter>object_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This returns a reference to a registered object. This is useful
|
||||
This is useful
|
||||
from within a custom function when you need direct access to a
|
||||
registered object.
|
||||
<link linkend="api.register.object">registered object</link>. See
|
||||
<link linkend="advanced.features.objects">objects</link> for more info.
|
||||
</para>
|
||||
<example>
|
||||
<title>get_registered_object</title>
|
||||
<title>get_registered_object()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
function smarty_block_foo($params, &$smarty)
|
||||
function smarty_block_foo($params, &$smarty)
|
||||
{
|
||||
if (isset($params['object'])) {
|
||||
// get reference to registered object
|
||||
@@ -33,6 +34,13 @@ function smarty_block_foo($params, &$smarty)
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.register.object">register_object()</link>,
|
||||
<link linkend="api.unregister.object">unregister_object()</link>
|
||||
and
|
||||
<link linkend="advanced.features.objects">objects section</link>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,18 +2,19 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.get.template.vars">
|
||||
<refnamediv>
|
||||
<refname>get_template_vars</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>get_template_vars()</refname>
|
||||
<refpurpose>returns assigned variable value(s)</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>get_template_vars</methodname>
|
||||
<methodparam choice="opt"><type>string</type><parameter>varname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This returns the given assigned variable value. If no parameter
|
||||
is given, an array of all assigned variables is returned.
|
||||
If no parameter
|
||||
is given, an array of all <link linkend="api.assign">assigned</link>
|
||||
variables are returned.
|
||||
</para>
|
||||
<example>
|
||||
<title>get_template_vars</title>
|
||||
@@ -35,7 +36,10 @@ print_r($tpl_vars);
|
||||
<para>
|
||||
See also <link linkend="api.assign">assign()</link>,
|
||||
<link linkend="language.function.assign">{assign}</link>,
|
||||
<link linkend="api.clear.assign">clear_assign()</link>
|
||||
<link linkend="api.assign.by.ref">assign_by_ref()</link>,
|
||||
<link linkend="api.append">append()</link>,
|
||||
<link linkend="api.clear.assign">clear_assign()</link>,
|
||||
<link linkend="api.clear.all.assign">clear_all_assign()</link>
|
||||
and
|
||||
<link linkend="api.get.config.vars">get_config_vars()</link>
|
||||
</para>
|
||||
|
@@ -2,65 +2,69 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.is.cached">
|
||||
<refnamediv>
|
||||
<refname>is_cached</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>is_cached()</refname>
|
||||
<refpurpose>returns true if there is a valid cache for this template</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>is_cached</methodname>
|
||||
<methodparam><type>string</type><parameter>template</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter>
|
||||
</methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This returns &true; if there is a valid cache for this template.
|
||||
This only works if <link
|
||||
linkend="variable.caching">$caching</link> is set to true.
|
||||
linkend="variable.caching">$caching</link> is set to true. See also the
|
||||
<link linkend="caching">caching section</link>.
|
||||
</para>
|
||||
<example>
|
||||
<title>is_cached</title>
|
||||
<title>is_cached()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->caching = true;
|
||||
|
||||
if(!$smarty->is_cached("index.tpl")) {
|
||||
if(!$smarty->is_cached('index.tpl')) {
|
||||
// do database calls, assign vars here
|
||||
}
|
||||
|
||||
$smarty->display("index.tpl");
|
||||
$smarty->display('index.tpl');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
You can also pass a $cache id as an optional second parameter
|
||||
in case you want multiple caches for the given template.
|
||||
in case you want
|
||||
<link linkend="caching.multiple.caches">multiple caches</link>
|
||||
for the given template.
|
||||
</para>
|
||||
<para>
|
||||
You can supply a
|
||||
<link linkend="variable.compile.id">$compile id</link>
|
||||
as an optional third parameter.
|
||||
If you omit that parameter the persistent
|
||||
If you omit that parameter the persistent
|
||||
<link linkend="variable.compile.id">$compile_id</link> is used.
|
||||
</para>
|
||||
<para>
|
||||
If you do not want to pass a cache id but want to pass a compile
|
||||
id you have to pass <literal>null</literal> as cache id.
|
||||
If you do not want to pass a cache id but want to pass a
|
||||
<link linkend="variable.compile.id">$compile_id</link>
|
||||
you have to pass <emphasis>null</emphasis> as cache id.
|
||||
</para>
|
||||
<example>
|
||||
<title>is_cached with multiple-cache template</title>
|
||||
<title>is_cached() with multiple-cache template</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->caching = true;
|
||||
|
||||
if(!$smarty->is_cached("index.tpl", "FrontPage")) {
|
||||
if(!$smarty->is_cached('index.tpl', 'FrontPage')) {
|
||||
// do database calls, assign vars here
|
||||
}
|
||||
|
||||
$smarty->display("index.tpl", "FrontPage");
|
||||
$smarty->display('index.tpl', 'FrontPage');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
@@ -70,19 +74,29 @@ $smarty->display("index.tpl", "FrontPage");
|
||||
<note>
|
||||
<title>Technical Note</title>
|
||||
<para>
|
||||
If <literal>is_cached</literal> returns true it actually loads the
|
||||
If <literal>is_cached()</literal> returns true it actually loads the
|
||||
cached output and stores it internally. Any subsequent call to
|
||||
<link linkend="api.display">display()</link> or
|
||||
<link linkend="api.fetch">fetch()</link>
|
||||
will return this internally stored output and does not try to reload
|
||||
the cache file. This prevents a race condition that may occur when a
|
||||
second process clears the cache between the calls to is_cached and to
|
||||
display in the example above. This also means calls to
|
||||
second process clears the cache between the calls to is_cached() and to
|
||||
<link linkend="api.display">display()</link>
|
||||
in the example above. This also means calls to
|
||||
<link linkend="api.clear.cache">clear_cache()</link>
|
||||
and other changes of the cache-settings may have no effect after
|
||||
is_cached() returned true.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.clear.cache">clear_cache()</link>,
|
||||
<link linkend="api.clear.all.cache">clear_all_cache()</link>,
|
||||
and
|
||||
<link linkend="caching">caching section</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
@@ -105,3 +119,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
@@ -2,18 +2,18 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.load.filter">
|
||||
<refnamediv>
|
||||
<refname>load_filter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>load_filter()</refname>
|
||||
<refpurpose>load a filter plugin</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>load_filter</methodname>
|
||||
<methodparam><type>string</type><parameter>type</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function can be used to load a filter plugin. The first
|
||||
The first
|
||||
argument specifies the type of the filter to load and can be one
|
||||
of the following: 'pre', 'post', or 'output'. The second argument
|
||||
specifies the name of the filter plugin, for example, 'trim'.
|
||||
@@ -23,13 +23,28 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->load_filter('pre', 'trim'); // load prefilter named 'trim'
|
||||
$smarty->load_filter('pre', 'datefooter'); // load another prefilter named 'datefooter'
|
||||
$smarty->load_filter('output', 'compress'); // load output filter named 'compress'
|
||||
|
||||
// load prefilter named 'trim'
|
||||
$smarty->load_filter('pre', 'trim');
|
||||
|
||||
// load another prefilter named 'datefooter'
|
||||
$smarty->load_filter('pre', 'datefooter');
|
||||
|
||||
// load output filter named 'compress'
|
||||
$smarty->load_filter('output', 'compress');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.register.prefilter">register_prefilter()</link>,
|
||||
<link linkend="api.register.postfilter">register_postfilter()</link>,
|
||||
<link linkend="api.register.outputfilter">register_outputfilter()</link>
|
||||
and
|
||||
<link linkend="advanced.features">Advanced features</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.block">
|
||||
<refnamediv>
|
||||
<refname>register_block</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_block()</refname>
|
||||
<refpurpose>dynamically register block functions plugins</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_block</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
@@ -15,7 +15,8 @@
|
||||
<methodparam><type>mixed</type><parameter>cache_attrs</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically register block functions plugins.
|
||||
Use this to dynamically register
|
||||
<link linkend="plugins.block.functions">block functions plugins</link>.
|
||||
Pass in the block function name, followed by the PHP
|
||||
function callback that implements it.
|
||||
</para>
|
||||
@@ -33,18 +34,18 @@
|
||||
</para>
|
||||
<para>
|
||||
<parameter>cacheable</parameter> and <parameter>cache_attrs</parameter>
|
||||
can be omitted in most cases. See <link
|
||||
can be omitted in most cases. See <link
|
||||
linkend="caching.cacheable">Controlling Cacheability of Plugins' Output</link>
|
||||
on how to use them properly.
|
||||
</para>
|
||||
<example>
|
||||
<title>register_block</title>
|
||||
<title>register_block()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->register_block("translate", "do_translation");
|
||||
$smarty->register_block('translate', 'do_translation');
|
||||
|
||||
function do_translation ($params, $content, &$smarty, &$repeat)
|
||||
function do_translation ($params, $content, &$smarty, &$repeat)
|
||||
{
|
||||
if (isset($content)) {
|
||||
$lang = $params['lang'];
|
||||
@@ -67,6 +68,14 @@ Hello, world!
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.unregister.block">unregister_block()</link>
|
||||
and
|
||||
<link linkend="plugins.block.functions">Plugin Block Functions</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.compiler.function">
|
||||
<refnamediv>
|
||||
<refname>register_compiler_function</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_compiler_function()</refname>
|
||||
<refpurpose>dynamically register a compiler function plugin</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>register_compiler_function</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
@@ -14,17 +14,22 @@
|
||||
<methodparam><type>bool</type><parameter>cacheable</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically register a compiler function plugin.
|
||||
Pass in the compiler function name, followed by the PHP
|
||||
function that implements it.
|
||||
Pass in the
|
||||
<link linkend="plugins.compiler.functions">compiler function</link> name,
|
||||
followed by the PHP function that implements it.
|
||||
</para>
|
||||
<para>
|
||||
The php-function callback <parameter>impl</parameter> can be either (a) a string
|
||||
containing the function name or (b) an array of the form
|
||||
<literal>array(&$object, $method)</literal> with
|
||||
The php-function callback <parameter>impl</parameter> can be either:
|
||||
</para>
|
||||
<para>
|
||||
(a) a string containing the function name
|
||||
</para>
|
||||
<para>(b) an array of the form <literal>array(&$object, $method)</literal> with
|
||||
<literal>&$object</literal> being a reference to an
|
||||
object and <literal>$method</literal> being a string
|
||||
containing the mehod-name or (c) an array of the form
|
||||
containing the mehod-name
|
||||
</para>
|
||||
<para>(c) an array of the form
|
||||
<literal>array(&$class, $method)</literal> with
|
||||
<literal>$class</literal> being a classname and
|
||||
<literal>$method</literal> being a class method of that
|
||||
@@ -35,6 +40,16 @@
|
||||
most cases. See <link linkend="caching.cacheable">Controlling
|
||||
Cacheability of Plugins' Output</link> on how to it properly.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link
|
||||
linkend="api.unregister.compiler.function">unregister_compiler_function()
|
||||
</link>
|
||||
and
|
||||
<link linkend="plugins.compiler.functions">Plugin Compiler Functions</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,49 +2,56 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.function">
|
||||
<refnamediv>
|
||||
<refname>register_function</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_function()</refname>
|
||||
<refpurpose>dynamically register template function plugins</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_function</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>impl</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>cacheable</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>mixed</type><parameter>cache_attrs</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>mixed</type><parameter>cache_attrs</parameter>
|
||||
</methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically register template function plugins.
|
||||
Pass in the template function name, followed by the PHP
|
||||
function name that implements it.
|
||||
Pass in the <link linkend="plugins.functions">template function</link>
|
||||
name, followed by the PHP function name that implements it.
|
||||
</para>
|
||||
<para>
|
||||
The php-function callback <parameter>impl</parameter> can be either (a) a string
|
||||
containing the function name or (b) an array of the form
|
||||
The php-function callback <parameter>impl</parameter> can be either
|
||||
</para>
|
||||
<para>
|
||||
(a) a string containing the function name
|
||||
</para>
|
||||
<para>
|
||||
(b) an array of the form
|
||||
<literal>array(&$object, $method)</literal> with
|
||||
<literal>&$object</literal> being a reference to an
|
||||
object and <literal>$method</literal> being a string
|
||||
containing the mehod-name or (c) an array of the form
|
||||
<literal>array(&$class, $method)</literal> with
|
||||
<literal>$class</literal> being a classname and
|
||||
containing the mehod-name
|
||||
</para>
|
||||
<para>
|
||||
(c) an array of the form <literal>array(&$class, $method)</literal>
|
||||
with <literal>$class</literal> being a classname and
|
||||
<literal>$method</literal> being a class method of that
|
||||
class.
|
||||
</para>
|
||||
<para>
|
||||
<parameter>cacheable</parameter> and <parameter>cache_attrs</parameter> can be
|
||||
omitted in most cases. See <link
|
||||
linkend="caching.cacheable">Controlling Cacheability of Plugins' Output</link>
|
||||
<parameter>cacheable</parameter> and <parameter>cache_attrs</parameter> can be
|
||||
omitted in most cases. See <link
|
||||
linkend="caching.cacheable">Controlling Cacheability of Plugins' Output</link>
|
||||
on how to use them properly.
|
||||
</para>
|
||||
<example>
|
||||
<title>register_function</title>
|
||||
<title>register_function()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->register_function("date_now", "print_current_date");
|
||||
$smarty->register_function('date_now', 'print_current_date');
|
||||
|
||||
function print_current_date($params)
|
||||
function print_current_date($params)
|
||||
{
|
||||
if(empty($params['format'])) {
|
||||
$format = "%b %e, %Y";
|
||||
@@ -53,13 +60,30 @@ function print_current_date($params)
|
||||
return strftime($format,time());
|
||||
}
|
||||
}
|
||||
|
||||
// now you can use this in Smarty to print the current date: {date_now}
|
||||
// or, {date_now format="%Y/%m/%d"} to format it.
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
And in the template
|
||||
</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
{date_now}
|
||||
|
||||
{* or to format differently *}
|
||||
{date_now format="%Y/%m/%d"}
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.unregister.function">unregister_function()</link>
|
||||
and
|
||||
<link linkend="plugins.functions">Plugin functions</link>
|
||||
.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
@@ -82,3 +106,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
@@ -2,18 +2,18 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.modifier">
|
||||
<refnamediv>
|
||||
<refname>register_modifier</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_modifier()</refname>
|
||||
<refpurpose>dynamically register modifier plugin</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_modifier</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>impl</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically register modifier plugin. Pass in the
|
||||
Pass in the
|
||||
template modifier name, followed by the PHP function that it
|
||||
implements it.
|
||||
</para>
|
||||
@@ -30,25 +30,33 @@
|
||||
class.
|
||||
</para>
|
||||
<example>
|
||||
<title>register_modifier</title>
|
||||
<programlisting role="php">
|
||||
<title>register_modifier()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
// let's map PHP's stripslashes function to a Smarty modifier.
|
||||
$smarty->register_modifier('sslash', 'stripslashes');
|
||||
|
||||
$smarty->register_modifier("sslash", "stripslashes");
|
||||
|
||||
// now you can use {$var|sslash} to strip slashes from variables
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</programlisting>
|
||||
<para>template</para>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
<?php
|
||||
{* use 'sslash' to strip slashes from variables *}
|
||||
{$var|sslash}
|
||||
?>
|
||||
]]>
|
||||
</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>,
|
||||
|
@@ -2,26 +2,27 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.object">
|
||||
<refnamediv>
|
||||
<refname>register_object</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_object()</refname>
|
||||
<refpurpose>register an object for use in the templates</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_object</methodname>
|
||||
<methodparam><type>string</type><parameter>object_name</parameter></methodparam>
|
||||
<methodparam><type>object</type><parameter>object</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter>allowed_methods_properties</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter>allowed_methods_properties</parameter>
|
||||
</methodparam>
|
||||
<methodparam><type>boolean</type><parameter>format</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter>block_methods</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This is to register an object for use in the templates. See the
|
||||
<link linkend="advanced.features.objects">object section</link>
|
||||
of the manual for examples.
|
||||
See the
|
||||
<link linkend="advanced.features.objects">objects section</link>
|
||||
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>
|
||||
@@ -46,3 +47,4 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
|
||||
vim: et tw=78 syn=sgml
|
||||
vi: ts=1 sw=1
|
||||
-->
|
||||
|
||||
|
@@ -2,34 +2,55 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.outputfilter">
|
||||
<refnamediv>
|
||||
<refname>register_outputfilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_outputfilter()</refname>
|
||||
<refpurpose>dynamically register outputfilters</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_outputfilter</methodname>
|
||||
<methodparam><type>mixed</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically register outputfilters to operate on
|
||||
a template's output before it is displayed. See
|
||||
Use this to dynamically register
|
||||
<link linkend="plugins.outputfilters">outputfilters</link> to operate on
|
||||
a template's output before it is
|
||||
<link linkend="api.display">displayed</link>. See
|
||||
<link linkend="advanced.features.outputfilters">template output
|
||||
filters</link>
|
||||
for more information on how to set up an output filter function.
|
||||
</para>
|
||||
<para>
|
||||
The php-function callback <parameter>function</parameter> can be either (a) a string
|
||||
containing the function name or (b) an array of the form
|
||||
The php-function callback <parameter>function</parameter> can be either
|
||||
</para>
|
||||
<para>
|
||||
(a) a string
|
||||
containing the function name
|
||||
</para>
|
||||
<para>
|
||||
(b) an array of the form
|
||||
<literal>array(&$object, $method)</literal> with
|
||||
<literal>&$object</literal> being a reference to an
|
||||
object and <literal>$method</literal> being a string
|
||||
containing the mehod-name or (c) an array of the form
|
||||
containing the mehod-name
|
||||
</para>
|
||||
<para>
|
||||
(c) an array of the form
|
||||
<literal>array(&$class, $method)</literal> with
|
||||
<literal>$class</literal> being a classname and
|
||||
<literal>$method</literal> being a class method of that
|
||||
class.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.unregister.outputfilter">unregister_outputfilter()</link>,
|
||||
<link linkend="api.register.prefilter">register_prefilter()</link>,
|
||||
<link linkend="api.register.postfilter">register_postfilter()</link>,
|
||||
<link linkend="api.load.filter">load_filter()</link>,
|
||||
and
|
||||
<link linkend="advanced.features.outputfilters">template
|
||||
output filters</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,33 +2,54 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.postfilter">
|
||||
<refnamediv>
|
||||
<refname>register_postfilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_postfilter()</refname>
|
||||
<refpurpose>dynamically register postfilters</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_postfilter</methodname>
|
||||
<methodparam><type>mixed</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically register postfilters to run templates
|
||||
Use this to dynamically register
|
||||
<link linkend="advanced.features.postfilters">postfilters</link> to run templates
|
||||
through after they are compiled. See <link
|
||||
linkend="advanced.features.postfilters">template postfilters</link> for
|
||||
more information on how to setup a postfiltering function.
|
||||
</para>
|
||||
<para>
|
||||
The php-function callback <parameter>function</parameter> can be either (a) a string
|
||||
containing the function name or (b) an array of the form
|
||||
The php-function callback <parameter>function</parameter> can be either
|
||||
</para>
|
||||
<para>
|
||||
(a) a string containing the function name
|
||||
</para>
|
||||
<para>
|
||||
(b) an array of the form
|
||||
<literal>array(&$object, $method)</literal> with
|
||||
<literal>&$object</literal> being a reference to an
|
||||
object and <literal>$method</literal> being a string
|
||||
containing the mehod-name or (c) an array of the form
|
||||
containing the mehod-name
|
||||
</para>
|
||||
<para>
|
||||
(c) an array of the form
|
||||
<literal>array(&$class, $method)</literal> with
|
||||
<literal>$class</literal> being a classname and
|
||||
<literal>$method</literal> being a class method of that
|
||||
class.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.unregister.postfilter">unregister_postfilter()</link>,
|
||||
<link linkend="api.register.prefilter">register_prefilter()</link>,
|
||||
<link linkend="api.register.outputfilter">register_ouputfilter()</link>,
|
||||
<link linkend="api.load.filter">load_filter()</link>,
|
||||
and
|
||||
<link linkend="advanced.features.outputfilters">template
|
||||
output filters</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,33 +2,53 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.prefilter">
|
||||
<refnamediv>
|
||||
<refname>register_prefilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_prefilter()</refname>
|
||||
<refpurpose>dynamically register prefilters</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_prefilter</methodname>
|
||||
<methodparam><type>mixed</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically register prefilters to run templates
|
||||
through before they are compiled. See <link
|
||||
Use this to dynamically register
|
||||
<link linkend="advanced.features.prefilters">prefilters</link>
|
||||
to run templates through before they are compiled. See <link
|
||||
linkend="advanced.features.prefilters">template prefilters</link> for
|
||||
more information on how to setup a prefiltering function.
|
||||
</para>
|
||||
<para>
|
||||
The php-function callback <parameter>function</parameter> can be either (a) a string
|
||||
containing the function name or (b) an array of the form
|
||||
The php-function callback <parameter>function</parameter> can be either
|
||||
</para>
|
||||
<para>
|
||||
(a) a string
|
||||
containing the function name
|
||||
</para>
|
||||
<para>
|
||||
(b) an array of the form
|
||||
<literal>array(&$object, $method)</literal> with
|
||||
<literal>&$object</literal> being a reference to an
|
||||
object and <literal>$method</literal> being a string
|
||||
containing the mehod-name or (c) an array of the form
|
||||
containing the mehod-name
|
||||
</para>
|
||||
<para>
|
||||
(c) an array of the form
|
||||
<literal>array(&$class, $method)</literal> with
|
||||
<literal>$class</literal> being a classname and
|
||||
<literal>$method</literal> being a class method of that
|
||||
class.
|
||||
</para>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.unregister.prefilter">unregister_prefilter()</link>,
|
||||
<link linkend="api.register.postfilter">register_postfilter()</link>,
|
||||
<link linkend="api.register.outputfilter">register_ouputfilter()</link>,
|
||||
<link linkend="api.load.filter">load_filter()</link>,
|
||||
and
|
||||
<link linkend="advanced.features.outputfilters">template
|
||||
output filters</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,18 +2,20 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.register.resource">
|
||||
<refnamediv>
|
||||
<refname>register_resource</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>register_resource()</refname>
|
||||
<refpurpose>dynamically register resources</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Descrption</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>register_resource</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter>resource_funcs</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically register a resource plugin with Smarty.
|
||||
Use this to dynamically register a
|
||||
<link linkend="template.resources">resource plugin</link>
|
||||
with Smarty.
|
||||
Pass in the name of the resource and the array of PHP functions
|
||||
implementing it. See
|
||||
<link linkend="template.resources">template resources</link>
|
||||
@@ -40,18 +42,28 @@
|
||||
"secure" and "trusted".
|
||||
</para>
|
||||
<example>
|
||||
<title>register_resource</title>
|
||||
<title>register_resource()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->register_resource("db", array("db_get_template",
|
||||
"db_get_timestamp",
|
||||
"db_get_secure",
|
||||
"db_get_trusted"));
|
||||
$smarty->register_resource('db', array(
|
||||
'db_get_template',
|
||||
'db_get_timestamp',
|
||||
'db_get_secure',
|
||||
'db_get_trusted')
|
||||
);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.unregister.resource">unregister_resource()</link>
|
||||
and
|
||||
<link linkend="template.resources">template resources</link>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,18 +2,17 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.template.exists">
|
||||
<refnamediv>
|
||||
<refname>template_exists</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>template_exists()</refname>
|
||||
<refpurpose>checks whether the specified template exists</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>template_exists</methodname>
|
||||
<methodparam><type>string</type><parameter>template</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
This function checks whether the specified template exists. It can
|
||||
accept either a path to the template on the filesystem or a
|
||||
It can accept either a path to the template on the filesystem or a
|
||||
resource string specifying the template.
|
||||
</para>
|
||||
<para>
|
||||
|
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.trigger.error">
|
||||
<refnamediv>
|
||||
<refname>trigger_error</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>trigger_error()</refname>
|
||||
<refpurpose>output an error message</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>trigger_error</methodname>
|
||||
<methodparam><type>string</type><parameter>error_msg</parameter></methodparam>
|
||||
@@ -15,9 +15,9 @@
|
||||
<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
|
||||
used for the PHP
|
||||
<ulink url="&url.php-manual;trigger_error">trigger_error()</ulink>
|
||||
PHP function, i.e. E_USER_NOTICE,
|
||||
function, i.e. E_USER_NOTICE,
|
||||
E_USER_WARNING, etc. By default it's E_USER_WARNING.
|
||||
</para>
|
||||
<para>
|
||||
|
@@ -2,19 +2,28 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.block">
|
||||
<refnamediv>
|
||||
<refname>unregister_block</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_block()</refname>
|
||||
<refpurpose>dynamically unregister block function plugins</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_block</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically unregister block function plugin.
|
||||
Use this to dynamically unregister
|
||||
<link linkend="plugins.block.functions">block function plugins</link>.
|
||||
Pass in the block function <parameter>name</parameter>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.register.block">register_block()</link>
|
||||
and
|
||||
<link linkend="plugins.block.functions">Block Functions Plugins</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,19 +2,29 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.compiler.function">
|
||||
<refnamediv>
|
||||
<refname>unregister_compiler_function</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_compiler_function()</refname>
|
||||
<refpurpose>dynamically unregister a compiler function</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_compiler_function</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically unregister a compiler function. Pass in
|
||||
Pass in
|
||||
the <parameter>name</parameter> of the compiler function.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link
|
||||
linkend="api.register.compiler.function">register_compiler_function()
|
||||
</link>
|
||||
and
|
||||
<link linkend="plugins.compiler.functions">Plugin Compiler Functions</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -3,16 +3,15 @@
|
||||
<refentry id="api.unregister.function">
|
||||
<refnamediv>
|
||||
<refname>unregister_function</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refpurpose>dynamically unregister template function plugin</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_function</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically unregister template function plugin.
|
||||
Pass in the template function name.
|
||||
</para>
|
||||
<example>
|
||||
@@ -20,13 +19,22 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// we don't want template designers to have access to system files
|
||||
|
||||
$smarty->unregister_function("fetch");
|
||||
// we don't want template designers to have access to system files
|
||||
$smarty->unregister_function('fetch');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link
|
||||
linkend="api.register.function">register_function()
|
||||
</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,31 +2,37 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.modifier">
|
||||
<refnamediv>
|
||||
<refname>unregister_modifier</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_modifier()</refname>
|
||||
<refpurpose>dynamically unregister modifier plugin</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_modifier</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically unregister modifier plugin. Pass in the
|
||||
template modifier name.
|
||||
Pass in the template modifier name.
|
||||
</para>
|
||||
<example>
|
||||
<title>unregister_modifier</title>
|
||||
<title>unregister_modifier()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// we don't want template designers to strip tags from elements
|
||||
|
||||
$smarty->unregister_modifier("strip_tags");
|
||||
// we don't want template designers to strip tags from elements
|
||||
$smarty->unregister_modifier('strip_tags');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.register.modifier">register_modifier()</link>
|
||||
and
|
||||
<link linkend="plugins.modifiers">Plugin modifiers</link>,
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,19 +2,22 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.object">
|
||||
<refnamediv>
|
||||
<refname>unregister_object</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_object()</refname>
|
||||
<refpurpose>dynamically unregister an object</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_object</methodname>
|
||||
<methodparam><type>string</type><parameter>object_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to unregister an object.
|
||||
</para>
|
||||
<para>See also <link linkend="api.register.object">register_object</link> <link linkend="advanced.features.objects">object section</link></para>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.register.object">register_object()</link>
|
||||
and
|
||||
<link linkend="advanced.features.objects">objects section</link>
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,11 +2,11 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.outputfilter">
|
||||
<refnamediv>
|
||||
<refname>unregister_outputfilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_outputfilter()</refname>
|
||||
<refpurpose>dynamically unregister an output filter</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_outputfilter</methodname>
|
||||
<methodparam><type>string</type><parameter>function_name</parameter></methodparam>
|
||||
@@ -14,6 +14,14 @@
|
||||
<para>
|
||||
Use this to dynamically unregister an output filter.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.register.outputfilter">register_outputfilter()</link>
|
||||
and
|
||||
<link linkend="advanced.features.outputfilters">template
|
||||
output filters</link>.
|
||||
</para>
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,18 +2,24 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.postfilter">
|
||||
<refnamediv>
|
||||
<refname>unregister_postfilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_postfilter()</refname>
|
||||
<refpurpose>dynamically unregister a postfilter</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_postfilter</methodname>
|
||||
<methodparam><type>string</type><parameter>function_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically unregister a postfilter.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.unregister.postfilter">register_postfilter()</link>
|
||||
and
|
||||
<link linkend="plugins.prefilters.postfilters">template
|
||||
post filters</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,18 +2,23 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.prefilter">
|
||||
<refnamediv>
|
||||
<refname>unregister_prefilter</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_prefilter()</refname>
|
||||
<refpurpose>dynamically unregister a prefilter</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_prefilter</methodname>
|
||||
<methodparam><type>string</type><parameter>function_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically unregister a prefilter.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.register.prefilter">register_prefilter()</link>
|
||||
and
|
||||
<link linkend="plugins.prefilters.postfilters">pre filters</link>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
@@ -2,29 +2,39 @@
|
||||
<!-- $Revision$ -->
|
||||
<refentry id="api.unregister.resource">
|
||||
<refnamediv>
|
||||
<refname>unregister_resource</refname>
|
||||
<refpurpose></refpurpose>
|
||||
<refname>unregister_resource()</refname>
|
||||
<refpurpose>dynamically unregister a resource plugin</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1>
|
||||
<title />
|
||||
<title>Description</title>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>unregister_resource</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Use this to dynamically unregister a resource plugin. Pass in the
|
||||
Pass in the
|
||||
name of the resource.
|
||||
</para>
|
||||
<example>
|
||||
<title>unregister_resource</title>
|
||||
<programlisting role="php">
|
||||
<title>unregister_resource()</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$smarty->unregister_resource("db");
|
||||
|
||||
$smarty->unregister_resource('db');
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
|
||||
<para>
|
||||
See also
|
||||
<link linkend="api.register.resource">register_resource()</link>
|
||||
and
|
||||
<link linkend="template.resources">template resources</link>
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
</refentry>
|
||||
<!-- Keep this comment at the end of the file
|
||||
|
Reference in New Issue
Block a user