WS, and switched to methodsynppsis

This commit is contained in:
didou
2004-04-18 19:22:55 +00:00
parent 2e4e68462c
commit bdafb7ea6c
38 changed files with 1165 additions and 1000 deletions

View File

@@ -1,41 +1,39 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.append.by.ref"> <refentry id="api.append.by.ref">
<title>append_by_ref</title> <refnamediv>
<funcsynopsis> <refname>append_by_ref</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>append_by_ref</function></funcdef> </refnamediv>
<paramdef>string <parameter>varname</parameter></paramdef> <refsect1>
<paramdef>mixed <parameter>var</parameter></paramdef> <title />
</funcprototype> <methodsynopsis>
<funcprototype> <type>void</type><methodname>append_by_ref</methodname>
<funcdef>void <function>append_by_ref</function></funcdef> <methodparam><type>string</type><parameter>varname</parameter></methodparam>
<paramdef>string <parameter>varname</parameter></paramdef> <methodparam><type>mixed</type><parameter>var</parameter></methodparam>
<paramdef>mixed <parameter>var</parameter></paramdef> <methodparam choice="opt"><type>bool</type><parameter>merge</parameter></methodparam>
<paramdef>boolean <parameter>merge</parameter></paramdef> </methodsynopsis>
</funcprototype> <para>
</funcsynopsis> This is used to append values to the templates by reference.
<para> If you append a variable by reference then change its
This is used to append values to the templates by reference. value, the appended value sees the change as well. For objects,
If you append a variable by reference then change its append_by_ref() also avoids an in-memory copy of the appended object.
value, the appended value sees the change as well. For objects, See the PHP manual on variable referencing for an in-depth
append_by_ref() also avoids an in-memory copy of the appended object. explanation. If you pass the optional third parameter of true,
See the PHP manual on variable referencing for an in-depth the value will be merged with the current array instead of appended.
explanation. If you pass the optional third parameter of true, </para>
the value will be merged with the current array instead of appended. <note>
</para> <title>Technical Note</title>
<note> <para>
<title>Technical Note</title> The <parameter>merge</parameter> parameter respects array keys, so if
<para> you merge two numerically indexed arrays, they may overwrite each other
The merge parameter respects array keys, so if you merge two or result in non-sequential keys. This is unlike the array_merge() function
numerically indexed arrays, they may overwrite each other or result in of PHP which wipes out numerical keys and renumbers them.
non-sequential keys. This is unlike the array_merge() function of PHP </para>
which wipes out numerical keys and renumbers them. </note>
</para> <example>
</note> <title>append_by_ref</title>
<example> <programlisting role="php">
<title>append_by_ref</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// appending name/value pairs // appending name/value pairs
@@ -43,9 +41,10 @@ $smarty->append_by_ref("Name", $myname);
$smarty->append_by_ref("Address", $address); $smarty->append_by_ref("Address", $address);
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -65,4 +64,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,57 +1,56 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.append"> <refentry id="api.append">
<title>append</title> <refnamediv>
<funcsynopsis> <refname>append</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>append</function></funcdef> </refnamediv>
<paramdef>mixed <parameter>var</parameter></paramdef> <refsect1>
</funcprototype> <title />
<funcprototype> <methodsynopsis>
<funcdef>void <function>append</function></funcdef> <type>void</type><methodname>append</methodname>
<paramdef>string <parameter>varname</parameter></paramdef> <methodparam><type>mixed</type><parameter>var</parameter></methodparam>
<paramdef>mixed <parameter>var</parameter></paramdef> </methodsynopsis>
</funcprototype> <methodsynopsis>
<funcprototype> <type>void</type><methodname>append</methodname>
<funcdef>void <function>append</function></funcdef> <methodparam><type>string</type><parameter>varname</parameter></methodparam>
<paramdef>string <parameter>varname</parameter></paramdef> <methodparam><type>mixed</type><parameter>var</parameter></methodparam>
<paramdef>mixed <parameter>var</parameter></paramdef> <methodparam choice="opt"><type>bool</type><parameter>merge</parameter></methodparam>
<paramdef>boolean <parameter>merge</parameter></paramdef> </methodsynopsis>
</funcprototype> <para>
</funcsynopsis> This is used to append an element to an assigned array. If you append
<para> to a string value, it is converted to an array value and then
This is used to append an element to an assigned array. If you append appended to. You can explicitly pass name/value pairs, or associative
to a string value, it is converted to an array value and then arrays containing the name/value pairs. If you pass the optional third
appended to. You can explicitly pass name/value pairs, or associative parameter of true, the value will be merged with the current array
arrays containing the name/value pairs. If you pass the optional third instead of appended.
parameter of true, the value will be merged with the current array </para>
instead of appended. <note>
</para> <title>Technical Note</title>
<note> <para>
<title>Technical Note</title> The merge parameter respects array keys, so if you merge two
<para> numerically indexed arrays, they may overwrite each other or result in
The merge parameter respects array keys, so if you merge two non-sequential keys. This is unlike the array_merge() function of PHP
numerically indexed arrays, they may overwrite each other or result in which wipes out numerical keys and renumbers them.
non-sequential keys. This is unlike the array_merge() function of PHP </para>
which wipes out numerical keys and renumbers them. </note>
</para> <example>
</note> <title>append</title>
<example> <programlisting role="php">
<title>append</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// passing name/value pairs // passing name/value pairs
$smarty->append("Name","Fred"); $smarty->append("Name", "Fred");
$smarty->append("Address",$address); $smarty->append("Address", $address);
// passing an associative array // passing an associative array
$smarty->append(array("city" => "Lincoln","state" => "Nebraska")); $smarty->append(array("city" => "Lincoln", "state" => "Nebraska"));
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -71,4 +70,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,32 +1,35 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.assign.by.ref"> <refentry id="api.assign.by.ref">
<title>assign_by_ref</title> <refnamediv>
<funcsynopsis> <refname>assign_by_ref</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>assign_by_ref</function></funcdef> </refnamediv>
<paramdef>string <parameter>varname</parameter></paramdef> <refsect1>
<paramdef>mixed <parameter>var</parameter></paramdef> <title />
</funcprototype> <methodsynopsis>
</funcsynopsis> <type>void</type><methodname>assign_by_ref</methodname>
<para> <methodparam><type>string</type><parameter>varname</parameter></methodparam>
This is used to assign values to the templates by reference instead of <methodparam><type>mixed</type><parameter>var</parameter></methodparam>
making a copy. See the PHP manual on variable referencing for an explanation. </methodsynopsis>
</para> <para>
<note> This is used to assign values to the templates by reference instead of
<title>Technical Note</title> making a copy. See the PHP manual on variable referencing for an explanation.
<para> </para>
This is used to assign values to the templates by reference. <note>
If you assign a variable by reference then change its <title>Technical Note</title>
value, the assigned value sees the change as well. For objects, <para>
assign_by_ref() also avoids an in-memory copy of the assigned object. This is used to assign values to the templates by reference.
See the PHP manual on variable referencing for an in-depth If you assign a variable by reference then change its
explanation. value, the assigned value sees the change as well. For objects,
</para> assign_by_ref() also avoids an in-memory copy of the assigned object.
</note> See the PHP manual on variable referencing for an in-depth
<example> explanation.
<title>assign_by_ref</title> </para>
<programlisting role="php"> </note>
<example>
<title>assign_by_ref</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// passing name/value pairs // passing name/value pairs
@@ -34,9 +37,10 @@ $smarty->assign_by_ref('Name', $myname);
$smarty->assign_by_ref('Address', $address); $smarty->assign_by_ref('Address', $address);
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -56,4 +60,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,26 +1,29 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.assign"> <refentry id="api.assign">
<title>assign</title> <refnamediv>
<funcsynopsis> <refname>assign</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>assign</function></funcdef> </refnamediv>
<paramdef>mixed <parameter>var</parameter></paramdef> <refsect1>
</funcprototype> <title />
<funcprototype> <methodsynopsis>
<funcdef>void <function>assign</function></funcdef> <type>void</type><methodname>assign</methodname>
<paramdef>string <parameter>varname</parameter></paramdef> <methodparam><type>mixed</type><parameter>var</parameter></methodparam>
<paramdef>mixed <parameter>var</parameter></paramdef> </methodsynopsis>
</funcprototype> <methodsynopsis>
</funcsynopsis> <type>void</type><methodname>assign</methodname>
<para> <methodparam><type>string</type><parameter>varname</parameter></methodparam>
This is used to assign values to the templates. You can <methodparam><type>mixed</type><parameter>var</parameter></methodparam>
explicitly pass name/value pairs, or associative arrays </methodsynopsis>
containing the name/value pairs. <para>
</para> This is used to assign values to the templates. You can
<example> explicitly pass name/value pairs, or associative arrays
<title>assign</title> containing the name/value pairs.
<programlisting role="php"> </para>
<example>
<title>assign</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// passing name/value pairs // passing name/value pairs
@@ -31,9 +34,10 @@ $smarty->assign('Address', $address);
$smarty->assign(array("city" => "Lincoln", "state" => "Nebraska")); $smarty->assign(array("city" => "Lincoln", "state" => "Nebraska"));
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -53,4 +57,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,28 +1,32 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.clear.all.assign"> <refentry id="api.clear.all.assign">
<title>clear_all_assign</title> <refnamediv>
<funcsynopsis> <refname>clear_all_assign</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>clear_all_assign</function></funcdef> </refnamediv>
<paramdef><parameter></parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>clear_all_assign</methodname>
This clears the values of all assigned variables. <void />
</para> </methodsynopsis>
<example> <para>
<title>clear_all_assign</title> This clears the values of all assigned variables.
<programlisting role="php"> </para>
<example>
<title>clear_all_assign</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// clear all assigned variables // clear all assigned variables
$smarty->clear_all_assign(); $smarty->clear_all_assign();
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -42,4 +46,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,30 +1,34 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.clear.all.cache"> <refentry id="api.clear.all.cache">
<title>clear_all_cache</title> <refnamediv>
<funcsynopsis> <refname>clear_all_cache</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>clear_all_cache</function></funcdef> </refnamediv>
<paramdef>int <parameter>expire time</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>clear_all_cache</methodname>
This clears the entire template cache. As an optional <methodparam choice="opt"><type>int</type><parameter>expire_time</parameter></methodparam>
parameter, you can supply a minimum age in seconds the cache </methodsynopsis>
files must be before they will get cleared. <para>
</para> This clears the entire template cache. As an optional
<example> parameter, you can supply a minimum age in seconds the cache
<title>clear_all_cache</title> files must be before they will get cleared.
<programlisting role="php"> </para>
<example>
<title>clear_all_cache</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// clear the entire cache // clear the entire cache
$smarty->clear_all_cache(); $smarty->clear_all_cache();
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -44,4 +48,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,32 +1,36 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.clear.assign"> <refentry id="api.clear.assign">
<title>clear_assign</title> <refnamediv>
<funcsynopsis> <refname>clear_assign</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>clear_assign</function></funcdef> </refnamediv>
<paramdef>string <parameter>var</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>clear_assign</methodname>
This clears the value of an assigned variable. This <methodparam><type>mixed</type><parameter>var</parameter></methodparam>
can be a single value, or an array of values. </methodsynopsis>
</para> <para>
<example> This clears the value of an assigned variable. This
<title>clear_assign</title> can be a single value, or an array of values.
<programlisting role="php"> </para>
<example>
<title>clear_assign</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// clear a single variable // clear a single variable
$smarty->clear_assign("Name"); $smarty->clear_assign("Name");
// clear multiple variables // clear multiple variables
$smarty->clear_assign(array("Name","Address","Zip")); $smarty->clear_assign(array("Name", "Address", "Zip"));
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -46,4 +50,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,40 +1,47 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.clear.cache"> <refentry id="api.clear.cache">
<title>clear_cache</title> <refnamediv>
<methodsynopsis> <refname>clear_cache</refname>
<type>void</type><methodname>clear_cache</methodname> <refpurpose></refpurpose>
<methodparam choice="opt"><type>string</type><parameter>template</parameter></methodparam> </refnamediv>
<methodparam choice="opt"><type>string</type><parameter>cache id</parameter></methodparam> <refsect1>
<methodparam choice="opt"><type>string</type><parameter>compile id</parameter></methodparam> <title />
<methodparam choice="opt"><type>int</type><parameter>expire time</parameter></methodparam> <methodsynopsis>
</methodsynopsis> <type>void</type><methodname>clear_cache</methodname>
<para> <methodparam><type>string</type><parameter>template</parameter></methodparam>
This clears the cache for a specific template. If you have <methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam>
multiple caches for this template, you can clear a specific <methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
cache by supplying the cache id as the second parameter. You <methodparam choice="opt"><type>int</type><parameter>expire_time</parameter></methodparam>
can also pass a compile id as a third parameter. You can "group" </methodsynopsis>
templates together so they can be removed as a group. See the <para>
<link linkend="caching">caching section</link> for more This clears the cache for a specific <parameter>template</parameter>.
information. As an optional fourth parameter, you can supply a If you have multiple caches for this template, you can clear a specific
minimum age in seconds the cache file must be before it will cache by supplying the <parameter>cache_id</parameter> as the second
get cleared. parameter.
</para> You can also pass a <parameter>compile_id</parameter> as a third parameter.
<example> You can "group" templates together so they can be removed as a group. See the
<title>clear_cache</title> <link linkend="caching">caching section</link> for more
<programlisting role="php"> 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>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// clear the cache for a template // 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 // 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> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -54,4 +61,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,25 +1,30 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.clear.compiled.tpl"> <refentry id="api.clear.compiled.tpl">
<title>clear_compiled_tpl</title> <refnamediv>
<methodsynopsis> <refname>clear_compiled_tpl</refname>
<type>void</type><methodname>clear_compiled_tpl</methodname> <refpurpose></refpurpose>
<methodparam choice="opt"><type>string</type><parameter>tpl_file</parameter></methodparam> </refnamediv>
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam> <refsect1>
<methodparam choice="opt"><type>int</type><parameter>exp_time</parameter></methodparam> <title />
</methodsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>clear_compiled_tpl</methodname>
This clears the compiled version of the specified template <methodparam choice="opt"><type>string</type><parameter>tpl_file</parameter></methodparam>
resource, or all compiled template files if one is not specified. <methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
if you pass a compile_id only the compiled template for this <methodparam choice="opt"><type>int</type><parameter>exp_time</parameter></methodparam>
specific compile_id is cleared. if you pass an exp_time, then only </methodsynopsis>
compiled templates older than exp_time seconds are cleared, by <para>
default all compiled templates are cleared regardless of their age. This clears the compiled version of the specified template
This function is for advanced use only, not normally needed. resource, or all compiled template files if one is not specified.
</para> if you pass a compile_id only the compiled template for this
<example> specific compile_id is cleared. if you pass an exp_time, then only
<title>clear_compiled_tpl</title> compiled templates older than exp_time seconds are cleared, by
<programlisting role="php"> 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>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// clear a specific template resource // clear a specific template resource
@@ -29,9 +34,10 @@ $smarty->clear_compiled_tpl("index.tpl");
$smarty->clear_compiled_tpl(); $smarty->clear_compiled_tpl();
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -51,4 +57,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,18 +1,23 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.clear.config"> <refentry id="api.clear.config">
<title>clear_config</title> <refnamediv>
<methodsynopsis> <refname>clear_config</refname>
<type>void</type><methodname>clear_config</methodname> <refpurpose></refpurpose>
<methodparam choice="opt"><type>string</type><parameter>var</parameter></methodparam> </refnamediv>
</methodsynopsis> <refsect1>
<para> <title />
This clears all assigned config variables. If a variable name is <methodsynopsis>
supplied, only that variable is cleared. <type>void</type><methodname>clear_config</methodname>
</para> <methodparam choice="opt"><type>string</type><parameter>var</parameter></methodparam>
<example> </methodsynopsis>
<title>clear_config</title> <para>
<programlisting role="php"> This clears all assigned config variables. If a variable name is
supplied, only that variable is cleared.
</para>
<example>
<title>clear_config</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// clear all assigned config variables. // clear all assigned config variables.
@@ -22,9 +27,10 @@ $smarty->clear_config();
$smarty->clear_config('foobar'); $smarty->clear_config('foobar');
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -44,4 +50,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,44 +1,50 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.config.load"> <refentry id="api.config.load">
<title>config_load</title> <refnamediv>
<methodsynopsis> <refname>config_load</refname>
<type>void</type><methodname>config_load</methodname> <refpurpose></refpurpose>
<methodparam><type>string</type><parameter>file</parameter></methodparam> </refnamediv>
<methodparam choice="opt"><type>string</type><parameter>section</parameter></methodparam> <refsect1>
</methodsynopsis> <title />
<para> <methodsynopsis>
This loads config file data and assigns it to the template. This <type>void</type><methodname>config_load</methodname>
works identical to the template <link <methodparam><type>string</type><parameter>file</parameter></methodparam>
linkend="language.function.config.load">config_load</link> <methodparam choice="opt"><type>string</type><parameter>section</parameter></methodparam>
function. </methodsynopsis>
</para> <para>
<note> This loads config <parameter>file</parameter> data and assigns it to
<title>Technical Note</title> the template. This works identical to the template <link
<para> linkend="language.function.config.load">config_load</link>
As of Smarty 2.4.0, assigned template variables are kept across function.
invocations of fetch() and display(). Config vars loaded from </para>
config_load() are always global scope. Config files are also <note>
compiled for faster execution, and respect the <link <title>Technical Note</title>
linkend="variable.force.compile">force_compile</link> and <link <para>
linkend="variable.compile.check">compile_check</link> settings. As of Smarty 2.4.0, assigned template variables are kept across
</para> invocations of fetch() and display(). Config vars loaded from
</note> config_load() are always global scope. Config files are also
<example> compiled for faster execution, and respect the <link
<title>config_load</title> linkend="variable.force.compile">force_compile</link> and <link
<programlisting role="php"> linkend="variable.compile.check">compile_check</link> settings.
</para>
</note>
<example>
<title>config_load</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// load config variables and assign them // load config variables and assign them
$smarty->config_load('my.conf'); $smarty->config_load('my.conf');
// load a section // load a section
$smarty->config_load('my.conf','foobar'); $smarty->config_load('my.conf', 'foobar');
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -58,4 +64,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,35 +1,39 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.display"> <refentry id="api.display">
<title>display</title> <refnamediv>
<methodsynopsis> <refname>display</refname>
<type>void</type><methodname>display</methodname> <refpurpose></refpurpose>
<methodparam><type>string</type><parameter>template</parameter></methodparam> </refnamediv>
<methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam> <refsect1>
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam> <title />
</methodsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>display</methodname>
This displays the template. Supply a valid <link <methodparam><type>string</type><parameter>template</parameter></methodparam>
linkend="template.resources">template resource</link> <methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam>
type and path. As an optional second parameter, you can pass a <methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
cache id. See the <link linkend="caching">caching </methodsynopsis>
section</link> for more information. <para>
</para> This displays the template. Supply a valid <link
<para> linkend="template.resources">template resource</link>
As an optional third parameter, you can pass a compile id. This type and path. As an optional second parameter, you can pass a
is in the event that you want to compile different versions of cache id. See the <link linkend="caching">caching
the same template, such as having separate templates compiled section</link> for more information.
for different languages. Another use for compile_id is when you </para>
use more than one $template_dir but only one $compile_dir. Set <para>
a separate compile_id for each $template_dir, otherwise As an optional third parameter, you can pass a compile id. This
templates of the same name will overwrite each other. You can is in the event that you want to compile different versions of
also set the <link the same template, such as having separate templates compiled
linkend="variable.compile.id">$compile_id</link> variable once for different languages. Another use for compile_id is when you
instead of passing this to each call to display(). use more than one $template_dir but only one $compile_dir. Set
</para> a separate compile_id for each $template_dir, otherwise
<example> templates of the same name will overwrite each other. You can
<title>display</title> also set the <link linkend="variable.compile.id">$compile_id</link>
<programlisting role="php"> variable once instead of passing this to each call to display().
</para>
<example>
<title>display</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
include("Smarty.class.php"); include("Smarty.class.php");
@@ -37,20 +41,19 @@ $smarty = new Smarty;
$smarty->caching = true; $smarty->caching = true;
// only do db calls if cache doesn't exist // 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 // dummy up some data
$address = "245 N 50th"; $address = "245 N 50th";
$db_data = array( $db_data = array(
"City" => "Lincoln", "City" => "Lincoln",
"State" => "Nebraska", "State" => "Nebraska",
"Zip" => "68502" "Zip" => "68502"
); );
$smarty->assign("Name","Fred"); $smarty->assign("Name","Fred");
$smarty->assign("Address",$address); $smarty->assign("Address",$address);
$smarty->assign($db_data); $smarty->assign($db_data);
} }
@@ -58,16 +61,16 @@ if(!$smarty->is_cached("index.tpl"))
$smarty->display("index.tpl"); $smarty->display("index.tpl");
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
<para> <para>
Use the syntax for <link Use the syntax for <link
linkend="template.resources">template resources</link> to linkend="template.resources">template resources</link> to
display files outside of the $template_dir directory. display files outside of the $template_dir directory.
</para> </para>
<example> <example>
<title>function display template resource examples</title> <title>function display template resource examples</title>
<programlisting role="php"> <programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// absolute filepath // absolute filepath
@@ -83,10 +86,10 @@ $smarty->display("file:C:/www/pub/templates/header.tpl");
$smarty->display("db:header.tpl"); $smarty->display("db:header.tpl");
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</refsect1>
</sect1> </refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -106,4 +109,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,36 +1,42 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.fetch"> <refentry id="api.fetch">
<title>fetch</title> <refnamediv>
<methodsynopsis> <refname>fetch</refname>
<type>string</type><methodname>fetch</methodname> <refpurpose></refpurpose>
<methodparam><type>string</type><parameter>template</parameter></methodparam> </refnamediv>
<methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam> <refsect1>
<methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam> <title />
</methodsynopsis> <methodsynopsis>
<para> <type>string</type><methodname>fetch</methodname>
This returns the template output instead of displaying it. <methodparam><type>string</type><parameter>template</parameter></methodparam>
Supply a valid <link <methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam>
linkend="template.resources">template resource</link> <methodparam choice="opt"><type>string</type><parameter>compile_id</parameter></methodparam>
type and path. As an optional second parameter, you can pass a </methodsynopsis>
cache id. See the <link linkend="caching">caching <para>
section</link> for more information. This returns the template output instead of displaying it.
</para> Supply a valid <link
<para> linkend="template.resources">template resource</link>
As an optional third parameter, you can pass a compile id. This type and path. As an optional second parameter, you can pass a
is in the event that you want to compile different versions of cache id. See the <link linkend="caching">caching
the same template, such as having separate templates compiled section</link> for more information.
for different languages. Another use for compile_id is when you </para>
use more than one $template_dir but only one $compile_dir. Set <para>
a separate compile_id for each $template_dir, otherwise As an optional third parameter, you can pass a compile id. This
templates of the same name will overwrite each other. You can is in the event that you want to compile different versions of
also set the <link the same template, such as having separate templates compiled
linkend="variable.compile.id">$compile_id</link> variable once for different languages. Another use for compile_id is when you
instead of passing this to each call to fetch(). use more than one $template_dir but only one $compile_dir. Set
</para> a separate compile_id for each $template_dir, otherwise
<example> templates of the same name will overwrite each other. You can
<title>fetch</title> also set the <link
<programlisting role="php"> linkend="variable.compile.id">$compile_id</link> variable once
instead of passing this to each call to fetch().
</para>
<para>
<example>
<title>fetch</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
include("Smarty.class.php"); include("Smarty.class.php");
@@ -39,20 +45,19 @@ $smarty = new Smarty;
$smarty->caching = true; $smarty->caching = true;
// only do db calls if cache doesn't exist // 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 // dummy up some data
$address = "245 N 50th"; $address = "245 N 50th";
$db_data = array( $db_data = array(
"City" => "Lincoln", "City" => "Lincoln",
"State" => "Nebraska", "State" => "Nebraska",
"Zip" => "68502" "Zip" => "68502"
); );
$smarty->assign("Name","Fred"); $smarty->assign("Name","Fred");
$smarty->assign("Address",$address); $smarty->assign("Address",$address);
$smarty->assign($db_data); $smarty->assign($db_data);
} }
@@ -64,9 +69,11 @@ $output = $smarty->fetch("index.tpl");
echo $output; echo $output;
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -86,4 +93,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,18 +1,23 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.get.config.vars"> <refentry id="api.get.config.vars">
<title>get_config_vars</title> <refnamediv>
<methodsynopsis> <refname>get_config_vars</refname>
<type>array</type><methodname>get_config_vars</methodname> <refpurpose></refpurpose>
<methodparam choice="opt"><type>string</type><parameter>varname</parameter></methodparam> </refnamediv>
</methodsynopsis> <refsect1>
<para> <title />
This returns the given loaded config variable value. If no parameter <methodsynopsis>
is given, an array of all loaded config variables is returned. <type>array</type><methodname>get_config_vars</methodname>
</para> <methodparam choice="opt"><type>string</type><parameter>varname</parameter></methodparam>
<example> </methodsynopsis>
<title>get_config_vars</title> <para>
<programlisting role="php"> This returns the given loaded config variable value. If no parameter
is given, an array of all loaded config variables is returned.
</para>
<example>
<title>get_config_vars</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// get loaded config template var 'foo' // get loaded config template var 'foo'
@@ -25,9 +30,10 @@ $config_vars = $smarty->get_config_vars();
print_r($config_vars); print_r($config_vars);
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -47,4 +53,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,35 +1,40 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.get.registered.object"> <refentry id="api.get.registered.object">
<title>get_registered_object</title> <refnamediv>
<funcsynopsis> <refname>get_registered_object</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>array <function>get_registered_object</function></funcdef> </refnamediv>
<paramdef>string <parameter>object_name</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>array</type><methodname>get_registered_object</methodname>
This returns a reference to a registered object. This is useful <methodparam><type>string</type><parameter>object_name</parameter></methodparam>
from within a custom function when you need direct access to a </methodsynopsis>
registered object. <para>
</para> This returns a reference to a registered object. This is useful
<example> from within a custom function when you need direct access to a
<title>get_registered_object</title> registered object.
<programlisting role="php"> </para>
<example>
<title>get_registered_object</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
function smarty_block_foo($params, &$smarty) { function smarty_block_foo($params, &$smarty)
if (isset($params['object'])) { {
// get reference to registered object if (isset($params['object'])) {
$obj_ref = &$smarty->get_registered_object($params['object']); // get reference to registered object
// use $obj_ref is now a reference to the object $obj_ref = &$smarty->get_registered_object($params['object']);
} // use $obj_ref is now a reference to the object
}
} }
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -49,4 +54,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,18 +1,23 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.get.template.vars"> <refentry id="api.get.template.vars">
<title>get_template_vars</title> <refnamediv>
<methodsynopsis> <refname>get_template_vars</refname>
<type>array</type><methodname>get_template_vars</methodname> <refpurpose></refpurpose>
<methodparam choice="opt"><type>string</type><parameter>varname</parameter></methodparam> </refnamediv>
</methodsynopsis> <refsect1>
<para> <title />
This returns the given assigned variable value. If no parameter <methodsynopsis>
is given, an array of all assigned variables is returned. <type>array</type><methodname>get_template_vars</methodname>
</para> <methodparam choice="opt"><type>string</type><parameter>varname</parameter></methodparam>
<example> </methodsynopsis>
<title>get_template_vars</title> <para>
<programlisting role="php"> This returns the given assigned variable value. If no parameter
is given, an array of all assigned variables is returned.
</para>
<example>
<title>get_template_vars</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// get assigned template var 'foo' // get assigned template var 'foo'
@@ -25,9 +30,10 @@ $tpl_vars = $smarty->get_template_vars();
print_r($tpl_vars); print_r($tpl_vars);
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -47,4 +53,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,56 +1,60 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.is.cached"> <refentry id="api.is.cached">
<title>is_cached</title> <refnamediv>
<funcsynopsis> <refname>is_cached</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>boolean <function>is_cached</function></funcdef> </refnamediv>
<paramdef>string <parameter>template</parameter></paramdef> <refsect1>
<paramdef>[string <parameter>cache_id</parameter>]</paramdef> <title />
</funcprototype> <methodsynopsis>
</funcsynopsis> <type>bool</type><methodname>is_cached</methodname>
<para> <methodparam><type>string</type><parameter>template</parameter></methodparam>
This returns true if there is a valid cache for this template. <methodparam choice="opt"><type>string</type><parameter>cache_id</parameter></methodparam>
This only works if <link </methodsynopsis>
linkend="variable.caching">caching</link> is set to true. <para>
</para> This returns &true; if there is a valid cache for this template.
<example> This only works if <link
<title>is_cached</title> linkend="variable.caching">caching</link> is set to true.
<programlisting role="php"> </para>
<example>
<title>is_cached</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
$smarty->caching = true; $smarty->caching = true;
if(!$smarty->is_cached("index.tpl")) { if(!$smarty->is_cached("index.tpl")) {
// do database calls, assign vars here // do database calls, assign vars here
} }
$smarty->display("index.tpl"); $smarty->display("index.tpl");
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
<para> <para>
You can also pass a cache id as an optional second parameter 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 multiple caches for the given template.
</para> </para>
<example> <example>
<title>is_cached with multiple-cache template</title> <title>is_cached with multiple-cache template</title>
<programlisting role="php"> <programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
$smarty->caching = true; $smarty->caching = true;
if(!$smarty->is_cached("index.tpl","FrontPage")) { if(!$smarty->is_cached("index.tpl", "FrontPage")) {
// do database calls, assign vars here // do database calls, assign vars here
} }
$smarty->display("index.tpl","FrontPage"); $smarty->display("index.tpl", "FrontPage");
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -70,4 +74,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,33 +1,37 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.load.filter"> <refentry id="api.load.filter">
<title>load_filter</title> <refnamediv>
<funcsynopsis> <refname>load_filter</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>load_filter</function></funcdef> </refnamediv>
<paramdef>string <parameter>type</parameter></paramdef> <refsect1>
<paramdef>string <parameter>name</parameter></paramdef> <title />
</funcprototype> <methodsynopsis>
</funcsynopsis> <type>void</type><methodname>load_filter</methodname>
<para> <methodparam><type>string</type><parameter>type</parameter></methodparam>
This function can be used to load a filter plugin. The first <methodparam><type>string</type><parameter>name</parameter></methodparam>
argument specifies the type of the filter to load and can be one </methodsynopsis>
of the following: 'pre', 'post', or 'output'. The second argument <para>
specifies the name of the filter plugin, for example, 'trim'. This function can be used to load a filter plugin. The first
</para> argument specifies the type of the filter to load and can be one
<example> of the following: 'pre', 'post', or 'output'. The second argument
<title>loading filter plugins</title> specifies the name of the filter plugin, for example, 'trim'.
<programlisting role="php"> </para>
<example>
<title>loading filter plugins</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
$smarty->load_filter('pre', 'trim'); // load prefilter named 'trim' $smarty->load_filter('pre', 'trim'); // load prefilter named 'trim'
$smarty->load_filter('pre', 'datefooter'); // load another prefilter named 'datefooter' $smarty->load_filter('pre', 'datefooter'); // load another prefilter named 'datefooter'
$smarty->load_filter('output', 'compress'); // load output filter named 'compress' $smarty->load_filter('output', 'compress'); // load output filter named 'compress'
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -47,4 +51,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,61 +1,68 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.register.block"> <refentry id="api.register.block">
<title>register_block</title> <refnamediv>
<funcsynopsis> <refname>register_block</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>register_block</function></funcdef> </refnamediv>
<paramdef>string <parameter>name</parameter></paramdef> <refsect1>
<paramdef>mixed <parameter>impl</parameter></paramdef> <title />
<paramdef>bool <parameter>cacheable</parameter></paramdef> <methodsynopsis>
<paramdef>array or null <parameter>cache_attrs</parameter></paramdef> <type>void</type><methodname>register_block</methodname>
</funcprototype> <methodparam><type>string</type><parameter>name</parameter></methodparam>
</funcsynopsis> <methodparam><type>mixed</type><parameter>impl</parameter></methodparam>
<para> <methodparam><type>bool</type><parameter>cacheable</parameter></methodparam>
Use this to dynamically register block functions plugins. <methodparam><type>mixed</type><parameter>cache_attrs</parameter></methodparam>
Pass in the block function name, followed by the PHP </methodsynopsis>
function callback that implements it. <para>
</para> Use this to dynamically register block functions plugins.
Pass in the block function name, followed by the PHP
<para> function callback that implements it.
The php-function callback <parameter>impl</parameter> can be either (a) a string </para>
containing the function name or (b) an array of the form <para>
<literal>array(&amp;$object, $method)</literal> with The php-function callback <parameter>impl</parameter> can be either (a) a string
<literal>&amp;$object</literal> being a reference to an containing the function name or (b) an array of the form
object and <literal>$method</literal> being a string <literal>array(&amp;$object, $method)</literal> with
containing the mehod-name or (c) an array of the form <literal>&amp;$object</literal> being a reference to an
<literal>array(&amp;$class, $method)</literal> with object and <literal>$method</literal> being a string
<literal>$class</literal> being a classname and containing the mehod-name or (c) an array of the form
<literal>$method</literal> being a class method of that <literal>array(&amp;$class, $method)</literal> with
class. <literal>$class</literal> being a classname and
</para> <literal>$method</literal> being a class method of that
<para> class.
<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>
</para> <para>
<example> <parameter>cacheable</parameter> and <parameter>cache_attrs</parameter>
<title>register_block</title> can be omitted in most cases. See <link
<programlisting role="php"> linkend="caching.cacheable">Controlling Cacheability of Plugins' Output</link>
on how to use them properly.
</para>
<example>
<title>register_block</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?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']; if (isset($content)) {
// do some translation with $content $lang = $params['lang'];
return $translation; // do some translation with $content
} return $translation;
}
} }
?> ?>
{* template *} {* template *}
{translate lang="br"} {translate lang="br"}
Hello, world! Hello, world!
{/translate} {/translate}
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -75,4 +82,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,38 +1,42 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.register.compiler.function"> <refentry id="api.register.compiler.function">
<title>register_compiler_function</title> <refnamediv>
<funcsynopsis> <refname>register_compiler_function</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>register_compiler_function</function></funcdef> </refnamediv>
<paramdef>string <parameter>name</parameter></paramdef> <refsect1>
<paramdef>mixed <parameter>impl</parameter></paramdef> <title />
<paramdef>bool <parameter>cacheable</parameter></paramdef> <methodsynopsis>
</funcprototype> <type>bool</type><methodname>register_compiler_function</methodname>
</funcsynopsis> <methodparam><type>string</type><parameter>name</parameter></methodparam>
<para> <methodparam><type>mixed</type><parameter>impl</parameter></methodparam>
Use this to dynamically register a compiler function plugin. <methodparam><type>bool</type><parameter>cacheable</parameter></methodparam>
Pass in the compiler function name, followed by the PHP </methodsynopsis>
function that implements it. <para>
</para> Use this to dynamically register a compiler function plugin.
<para> Pass in the compiler function name, followed by the PHP
The php-function callback <parameter>impl</parameter> can be either (a) a string function that implements it.
containing the function name or (b) an array of the form </para>
<literal>array(&amp;$object, $method)</literal> with <para>
<literal>&amp;$object</literal> being a reference to an The php-function callback <parameter>impl</parameter> can be either (a) a string
object and <literal>$method</literal> being a string containing the function name or (b) an array of the form
containing the mehod-name or (c) an array of the form <literal>array(&amp;$object, $method)</literal> with
<literal>array(&amp;$class, $method)</literal> with <literal>&amp;$object</literal> being a reference to an
<literal>$class</literal> being a classname and object and <literal>$method</literal> being a string
<literal>$method</literal> being a class method of that containing the mehod-name or (c) an array of the form
class. <literal>array(&amp;$class, $method)</literal> with
</para> <literal>$class</literal> being a classname and
<para> <literal>$method</literal> being a class method of that
<parameter>$cacheable</parameter> can be omitted in class.
most cases. See <link linkend="caching.cacheable">Controlling </para>
Cacheability of Plugins' Output</link> on how to it properly. <para>
</para> <parameter>cacheable</parameter> can be omitted in
</sect1> most cases. See <link linkend="caching.cacheable">Controlling
Cacheability of Plugins' Output</link> on how to it properly.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -52,4 +56,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,58 +1,67 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.register.function"> <refentry id="api.register.function">
<title>register_function</title> <refnamediv>
<funcsynopsis> <refname>register_function</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>register_function</function></funcdef> </refnamediv>
<paramdef>string <parameter>name</parameter></paramdef> <refsect1>
<paramdef>mixed <parameter>impl</parameter></paramdef> <title />
<paramdef>bool <parameter>cacheable</parameter></paramdef> <methodsynopsis>
<paramdef>array or null <parameter>cache_attrs</parameter></paramdef> <type>void</type><methodname>register_function</methodname>
</funcprototype> <methodparam><type>string</type><parameter>name</parameter></methodparam>
</funcsynopsis> <methodparam><type>mixed</type><parameter>impl</parameter></methodparam>
<para> <methodparam><type>bool</type><parameter>cacheable</parameter></methodparam>
Use this to dynamically register template function plugins. <methodparam><type>mixed</type><parameter>cache_attrs</parameter></methodparam>
Pass in the template function name, followed by the PHP </methodsynopsis>
function name that implements it. <para>
</para> Use this to dynamically register template function plugins.
<para> Pass in the template function name, followed by the PHP
The php-function callback <parameter>impl</parameter> can be either (a) a string function name that implements it.
containing the function name or (b) an array of the form </para>
<literal>array(&amp;$object, $method)</literal> with <para>
<literal>&amp;$object</literal> being a reference to an The php-function callback <parameter>impl</parameter> can be either (a) a string
object and <literal>$method</literal> being a string containing the function name or (b) an array of the form
containing the mehod-name or (c) an array of the form <literal>array(&amp;$object, $method)</literal> with
<literal>array(&amp;$class, $method)</literal> with <literal>&amp;$object</literal> being a reference to an
<literal>$class</literal> being a classname and object and <literal>$method</literal> being a string
<literal>$method</literal> being a class method of that containing the mehod-name or (c) an array of the form
class. <literal>array(&amp;$class, $method)</literal> with
</para> <literal>$class</literal> being a classname and
<para> <literal>$method</literal> being a class method of that
<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. class.
</para> </para>
<example> <para>
<title>register_function</title> <parameter>cacheable</parameter> and <parameter>cache_attrs</parameter> can be
<programlisting role="php"> 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>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?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"; if(empty($params['format'])) {
else $format = "%b %e, %Y";
$format = $params['format']; } else {
$format = $params['format'];
return strftime($format,time()); return strftime($format,time());
}
} }
// now you can use this in Smarty to print the current date: {date_now} // now you can use this in Smarty to print the current date: {date_now}
// or, {date_now format="%Y/%m/%d"} to format it. // or, {date_now format="%Y/%m/%d"} to format it.
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -72,4 +81,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,47 +1,50 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.register.modifier"> <refentry id="api.register.modifier">
<title>register_modifier</title> <refnamediv>
<funcsynopsis> <refname>register_modifier</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>register_modifier</function></funcdef> </refnamediv>
<paramdef>string <parameter>name</parameter></paramdef> <refsect1>
<paramdef>mixed <parameter>impl</parameter></paramdef> <title />
</funcprototype> <methodsynopsis>
</funcsynopsis> <type>void</type><methodname>register_modifier</methodname>
<para> <methodparam><type>string</type><parameter>name</parameter></methodparam>
Use this to dynamically register modifier plugin. Pass in the <methodparam><type>mixed</type><parameter>impl</parameter></methodparam>
template modifier name, followed by the PHP function that it </methodsynopsis>
implements it. <para>
</para> Use this to dynamically register modifier plugin. Pass in the
<para> template modifier name, followed by the PHP function that it
The php-function callback <parameter>impl</parameter> can be either (a) a string implements it.
containing the function name or (b) an array of the form </para>
<literal>array(&amp;$object, $method)</literal> with <para>
<literal>&amp;$object</literal> being a reference to an The php-function callback <parameter>impl</parameter> can be either (a) a string
object and <literal>$method</literal> being a string containing the function name or (b) an array of the form
containing the mehod-name or (c) an array of the form <literal>array(&amp;$object, $method)</literal> with
<literal>array(&amp;$class, $method)</literal> with <literal>&amp;$object</literal> being a reference to an
<literal>$class</literal> being a classname and object and <literal>$method</literal> being a string
<literal>$method</literal> being a class method of that containing the mehod-name or (c) an array of the form
class. <literal>array(&amp;$class, $method)</literal> with
</para> <literal>$class</literal> being a classname and
<literal>$method</literal> being a class method of that
<example> class.
<title>register_modifier</title> </para>
<programlisting role="php"> <example>
<title>register_modifier</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// let's map PHP's stripslashes function to a Smarty modifier. // 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 // now you can use {$var|sslash} to strip slashes from variables
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -61,4 +64,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,23 +1,27 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.register.object"> <refentry id="api.register.object">
<title>register_object</title> <refnamediv>
<funcsynopsis> <refname>register_object</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>register_object</function></funcdef> </refnamediv>
<paramdef>string <parameter>object_name</parameter></paramdef> <refsect1>
<paramdef>object <parameter>$object</parameter></paramdef> <title />
<paramdef>array <parameter>allowed methods/properties</parameter></paramdef> <methodsynopsis>
<paramdef>boolean <parameter>format</parameter></paramdef> <type>void</type><methodname>register_object</methodname>
<paramdef>array <parameter>block methods</parameter></paramdef> <methodparam><type>string</type><parameter>object_name</parameter></methodparam>
</funcprototype> <methodparam><type>object</type><parameter>object</parameter></methodparam>
</funcsynopsis> <methodparam><type>array</type><parameter>allowed_methods_properties</parameter></methodparam>
<para> <methodparam><type>boolean</type><parameter>format</parameter></methodparam>
This is to register an object for use in the templates. See the <methodparam><type>array</type><parameter>block_methods</parameter></methodparam>
<link linkend="advanced.features.objects">object section</link> </methodsynopsis>
of the manual for examples. <para>
</para> This is to register an object for use in the templates. See the
</sect1> <link linkend="advanced.features.objects">object section</link>
of the manual for examples.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -37,4 +41,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,33 +1,37 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.register.outputfilter"> <refentry id="api.register.outputfilter">
<title>register_outputfilter</title> <refnamediv>
<funcsynopsis> <refname>register_outputfilter</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>register_outputfilter</function></funcdef> </refnamediv>
<paramdef>mixed <parameter>function</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>register_outputfilter</methodname>
Use this to dynamically register outputfilters to operate on <methodparam><type>mixed</type><parameter>function</parameter></methodparam>
a template's output before it is displayed. See </methodsynopsis>
<link linkend="advanced.features.outputfilters">template output <para>
filters</link> Use this to dynamically register outputfilters to operate on
for more information on how to set up an output filter function. a template's output before it is displayed. See
</para> <link linkend="advanced.features.outputfilters">template output
<para> filters</link>
The php-function callback <parameter>function</parameter> can be either (a) a string for more information on how to set up an output filter function.
containing the function name or (b) an array of the form </para>
<literal>array(&amp;$object, $method)</literal> with <para>
<literal>&amp;$object</literal> being a reference to an The php-function callback <parameter>function</parameter> can be either (a) a string
object and <literal>$method</literal> being a string containing the function name or (b) an array of the form
containing the mehod-name or (c) an array of the form <literal>array(&amp;$object, $method)</literal> with
<literal>array(&amp;$class, $method)</literal> with <literal>&amp;$object</literal> being a reference to an
<literal>$class</literal> being a classname and object and <literal>$method</literal> being a string
<literal>$method</literal> being a class method of that containing the mehod-name or (c) an array of the form
class. <literal>array(&amp;$class, $method)</literal> with
</para> <literal>$class</literal> being a classname and
</sect1> <literal>$method</literal> being a class method of that
class.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -47,4 +51,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,32 +1,36 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.register.postfilter"> <refentry id="api.register.postfilter">
<title>register_postfilter</title> <refnamediv>
<funcsynopsis> <refname>register_postfilter</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>register_postfilter</function></funcdef> </refnamediv>
<paramdef>mixed <parameter>function</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>register_postfilter</methodname>
Use this to dynamically register postfilters to run templates <methodparam><type>mixed</type><parameter>function</parameter></methodparam>
through after they are compiled. See <link </methodsynopsis>
linkend="advanced.features.postfilters">template postfilters</link> for <para>
more information on how to setup a postfiltering function. Use this to dynamically register postfilters to run templates
</para> through after they are compiled. See <link
<para> linkend="advanced.features.postfilters">template postfilters</link> for
The php-function callback <parameter>function</parameter> can be either (a) a string more information on how to setup a postfiltering function.
containing the function name or (b) an array of the form </para>
<literal>array(&amp;$object, $method)</literal> with <para>
<literal>&amp;$object</literal> being a reference to an The php-function callback <parameter>function</parameter> can be either (a) a string
object and <literal>$method</literal> being a string containing the function name or (b) an array of the form
containing the mehod-name or (c) an array of the form <literal>array(&amp;$object, $method)</literal> with
<literal>array(&amp;$class, $method)</literal> with <literal>&amp;$object</literal> being a reference to an
<literal>$class</literal> being a classname and object and <literal>$method</literal> being a string
<literal>$method</literal> being a class method of that containing the mehod-name or (c) an array of the form
class. <literal>array(&amp;$class, $method)</literal> with
</para> <literal>$class</literal> being a classname and
</sect1> <literal>$method</literal> being a class method of that
class.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -46,4 +50,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,32 +1,36 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.register.prefilter"> <refentry id="api.register.prefilter">
<title>register_prefilter</title> <refnamediv>
<funcsynopsis> <refname>register_prefilter</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>register_prefilter</function></funcdef> </refnamediv>
<paramdef>mixed <parameter>function</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>register_prefilter</methodname>
Use this to dynamically register prefilters to run templates <methodparam><type>mixed</type><parameter>function</parameter></methodparam>
through before they are compiled. See <link </methodsynopsis>
linkend="advanced.features.prefilters">template prefilters</link> for <para>
more information on how to setup a prefiltering function. Use this to dynamically register prefilters to run templates
</para> through before they are compiled. See <link
<para> linkend="advanced.features.prefilters">template prefilters</link> for
The php-function callback <parameter>function</parameter> can be either (a) a string more information on how to setup a prefiltering function.
containing the function name or (b) an array of the form </para>
<literal>array(&amp;$object, $method)</literal> with <para>
<literal>&amp;$object</literal> being a reference to an The php-function callback <parameter>function</parameter> can be either (a) a string
object and <literal>$method</literal> being a string containing the function name or (b) an array of the form
containing the mehod-name or (c) an array of the form <literal>array(&amp;$object, $method)</literal> with
<literal>array(&amp;$class, $method)</literal> with <literal>&amp;$object</literal> being a reference to an
<literal>$class</literal> being a classname and object and <literal>$method</literal> being a string
<literal>$method</literal> being a class method of that containing the mehod-name or (c) an array of the form
class. <literal>array(&amp;$class, $method)</literal> with
</para> <literal>$class</literal> being a classname and
</sect1> <literal>$method</literal> being a class method of that
class.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -46,4 +50,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,55 +1,59 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.register.resource"> <refentry id="api.register.resource">
<title>register_resource</title> <refnamediv>
<funcsynopsis> <refname>register_resource</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>register_resource</function></funcdef> </refnamediv>
<paramdef>string <parameter>name</parameter></paramdef> <refsect1>
<paramdef>array <parameter>resource_funcs</parameter></paramdef> <title />
</funcprototype> <methodsynopsis>
</funcsynopsis> <type>void</type><methodname>register_resource</methodname>
<para> <methodparam><type>string</type><parameter>name</parameter></methodparam>
Use this to dynamically register a resource plugin with Smarty. <methodparam><type>array</type><parameter>resource_funcs</parameter></methodparam>
Pass in the name of the resource and the array of PHP functions </methodsynopsis>
implementing it. See <para>
<link linkend="template.resources">template resources</link> Use this to dynamically register a resource plugin with Smarty.
for more information on how to setup a function for fetching Pass in the name of the resource and the array of PHP functions
templates. implementing it. See
</para> <link linkend="template.resources">template resources</link>
<note> for more information on how to setup a function for fetching
<title>Technical Note</title> templates.
<para> </para>
A resource name must be at least two characters in length. One <note>
character resource names will be ignored and used as part of the file <title>Technical Note</title>
path, such as $smarty->display('c:/path/to/index.tpl'); <para>
</para> A resource name must be at least two characters in length. One
</note> character resource names will be ignored and used as part of the file
<para> path, such as $smarty->display('c:/path/to/index.tpl');
The php-function-array <parameter>resource_funcs</parameter> </para>
must have 4 or 5 elements. With 4 elements the elements are </note>
the functions-callbacks for the respective "source", <para>
"timestamp", "secure" and "trusted" functions of the The php-function-array <parameter>resource_funcs</parameter>
resource. With 5 elements the first element has to be an must have 4 or 5 elements. With 4 elements the elements are
object reference or a class name of the object or class the functions-callbacks for the respective "source",
implementing the resource and the 4 following elements have "timestamp", "secure" and "trusted" functions of the
to be the method names implementing "source", "timestamp", resource. With 5 elements the first element has to be an
"secure" and "trusted". object reference or a class name of the object or class
</para> implementing the resource and the 4 following elements have
<example> to be the method names implementing "source", "timestamp",
<title>register_resource</title> "secure" and "trusted".
<programlisting role="php"> </para>
<example>
<title>register_resource</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
$smarty->register_resource("db", array("db_get_template", $smarty->register_resource("db", array("db_get_template",
"db_get_timestamp", "db_get_timestamp",
"db_get_secure", "db_get_secure",
"db_get_trusted")); "db_get_trusted"));
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -69,4 +73,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,19 +1,23 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.template.exists"> <refentry id="api.template.exists">
<title>template_exists</title> <refnamediv>
<funcsynopsis> <refname>template_exists</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>bool <function>template_exists</function></funcdef> </refnamediv>
<paramdef>string <parameter>template</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>bool</type><methodname>template_exists</methodname>
This function checks whether the specified template exists. It can <methodparam><type>string</type><parameter>template</parameter></methodparam>
accept either a path to the template on the filesystem or a </methodsynopsis>
resource string specifying the template. <para>
</para> This function checks whether the specified template exists. It can
</sect1> accept either a path to the template on the filesystem or a
resource string specifying the template.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -33,4 +37,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,21 +1,25 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.trigger.error"> <refentry id="api.trigger.error">
<title>trigger_error</title> <refnamediv>
<funcsynopsis> <refname>trigger_error</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>trigger_error</function></funcdef> </refnamediv>
<paramdef>string <parameter>error_msg</parameter></paramdef> <refsect1>
<paramdef>[int <parameter>level</parameter>]</paramdef> <title />
</funcprototype> <methodsynopsis>
</funcsynopsis> <type>void</type><methodname>trigger_error</methodname>
<para> <methodparam><type>string</type><parameter>error_msg</parameter></methodparam>
This function can be used to output an error message using Smarty. <methodparam choice="opt"><type>int</type><parameter>level</parameter></methodparam>
<parameter>level</parameter> parameter can be one of the values </methodsynopsis>
used for trigger_error() PHP function, i.e. E_USER_NOTICE, <para>
E_USER_WARNING, etc. By default it's E_USER_WARNING. This function can be used to output an error message using Smarty.
</para> <parameter>level</parameter> parameter can be one of the values
</sect1> used for trigger_error() PHP function, i.e. E_USER_NOTICE,
E_USER_WARNING, etc. By default it's E_USER_WARNING.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -35,4 +39,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,18 +1,22 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.unregister.block"> <refentry id="api.unregister.block">
<title>unregister_block</title> <refnamediv>
<funcsynopsis> <refname>unregister_block</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>unregister_block</function></funcdef> </refnamediv>
<paramdef>string <parameter>name</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>unregister_block</methodname>
Use this to dynamically unregister block function plugin. <methodparam><type>string</type><parameter>name</parameter></methodparam>
Pass in the block function name. </methodsynopsis>
</para> <para>
</sect1> Use this to dynamically unregister block function plugin.
Pass in the block function <parameter>name</parameter>.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -32,4 +36,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,18 +1,22 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.unregister.compiler.function"> <refentry id="api.unregister.compiler.function">
<title>unregister_compiler_function</title> <refnamediv>
<funcsynopsis> <refname>unregister_compiler_function</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>unregister_compiler_function</function></funcdef> </refnamediv>
<paramdef>string <parameter>name</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>unregister_compiler_function</methodname>
Use this to dynamically unregister a compiler function. Pass in <methodparam><type>string</type><parameter>name</parameter></methodparam>
the name of the compiler function. </methodsynopsis>
</para> <para>
</sect1> Use this to dynamically unregister a compiler function. Pass in
the <parameter>name</parameter> of the compiler function.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -32,4 +36,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,20 +1,23 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.unregister.function"> <refentry id="api.unregister.function">
<title>unregister_function</title> <refnamediv>
<funcsynopsis> <refname>unregister_function</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>unregister_function</function></funcdef> </refnamediv>
<paramdef>string <parameter>name</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>unregister_function</methodname>
Use this to dynamically unregister template function plugin. <methodparam><type>string</type><parameter>name</parameter></methodparam>
Pass in the template function name. </methodsynopsis>
</para> <para>
<example> Use this to dynamically unregister template function plugin.
<title>unregister_function</title> Pass in the template function name.
<programlisting role="php"> </para>
<example>
<title>unregister_function</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// we don't want template designers to have access to system files // we don't want template designers to have access to system files
@@ -22,9 +25,10 @@
$smarty->unregister_function("fetch"); $smarty->unregister_function("fetch");
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -44,4 +48,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,20 +1,23 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.unregister.modifier"> <refentry id="api.unregister.modifier">
<title>unregister_modifier</title> <refnamediv>
<funcsynopsis> <refname>unregister_modifier</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>unregister_modifier</function></funcdef> </refnamediv>
<paramdef>string <parameter>name</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>unregister_modifier</methodname>
Use this to dynamically unregister modifier plugin. Pass in the <methodparam><type>string</type><parameter>name</parameter></methodparam>
template modifier name. </methodsynopsis>
</para> <para>
<example> Use this to dynamically unregister modifier plugin. Pass in the
<title>unregister_modifier</title> template modifier name.
<programlisting role="php"> </para>
<example>
<title>unregister_modifier</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
// we don't want template designers to strip tags from elements // we don't want template designers to strip tags from elements
@@ -22,9 +25,10 @@
$smarty->unregister_modifier("strip_tags"); $smarty->unregister_modifier("strip_tags");
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -44,4 +48,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,17 +1,21 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.unregister.object"> <refentry id="api.unregister.object">
<title>unregister_object</title> <refnamediv>
<funcsynopsis> <refname>unregister_object</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>unregister_object</function></funcdef> </refnamediv>
<paramdef>string <parameter>object_name</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>unregister_object</methodname>
Use this to unregister an object. <methodparam><type>string</type><parameter>object_name</parameter></methodparam>
</para> </methodsynopsis>
</sect1> <para>
Use this to unregister an object.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -31,4 +35,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,17 +1,21 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.unregister.outputfilter"> <refentry id="api.unregister.outputfilter">
<title>unregister_outputfilter</title> <refnamediv>
<funcsynopsis> <refname>unregister_outputfilter</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>unregister_outputfilter</function></funcdef> </refnamediv>
<paramdef>string <parameter>function_name</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>unregister_outputfilter</methodname>
Use this to dynamically unregister an output filter. <methodparam><type>string</type><parameter>function_name</parameter></methodparam>
</para> </methodsynopsis>
</sect1> <para>
Use this to dynamically unregister an output filter.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -31,4 +35,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,17 +1,21 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.unregister.postfilter"> <refentry id="api.unregister.postfilter">
<title>unregister_postfilter</title> <refnamediv>
<funcsynopsis> <refname>unregister_postfilter</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>unregister_postfilter</function></funcdef> </refnamediv>
<paramdef>string <parameter>function_name</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>unregister_postfilter</methodname>
Use this to dynamically unregister a postfilter. <methodparam><type>string</type><parameter>function_name</parameter></methodparam>
</para> </methodsynopsis>
</sect1> <para>
Use this to dynamically unregister a postfilter.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -31,4 +35,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,17 +1,21 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.unregister.prefilter"> <refentry id="api.unregister.prefilter">
<title>unregister_prefilter</title> <refnamediv>
<funcsynopsis> <refname>unregister_prefilter</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>unregister_prefilter</function></funcdef> </refnamediv>
<paramdef>string <parameter>function_name</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>unregister_prefilter</methodname>
Use this to dynamically unregister a prefilter. <methodparam><type>string</type><parameter>function_name</parameter></methodparam>
</para> </methodsynopsis>
</sect1> <para>
Use this to dynamically unregister a prefilter.
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -31,4 +35,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->

View File

@@ -1,28 +1,32 @@
<?xml version="1.0" encoding="iso-8859-1"?> <?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision$ --> <!-- $Revision$ -->
<sect1 id="api.unregister.resource"> <refentry id="api.unregister.resource">
<title>unregister_resource</title> <refnamediv>
<funcsynopsis> <refname>unregister_resource</refname>
<funcprototype> <refpurpose></refpurpose>
<funcdef>void <function>unregister_resource</function></funcdef> </refnamediv>
<paramdef>string <parameter>name</parameter></paramdef> <refsect1>
</funcprototype> <title />
</funcsynopsis> <methodsynopsis>
<para> <type>void</type><methodname>unregister_resource</methodname>
Use this to dynamically unregister a resource plugin. Pass in the <methodparam><type>string</type><parameter>name</parameter></methodparam>
name of the resource. </methodsynopsis>
</para> <para>
<example> Use this to dynamically unregister a resource plugin. Pass in the
<title>unregister_resource</title> name of the resource.
<programlisting role="php"> </para>
<example>
<title>unregister_resource</title>
<programlisting role="php">
<![CDATA[ <![CDATA[
<?php <?php
$smarty->unregister_resource("db"); $smarty->unregister_resource("db");
?> ?>
]]> ]]>
</programlisting> </programlisting>
</example> </example>
</sect1> </refsect1>
</refentry>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:
mode: sgml mode: sgml
@@ -42,4 +46,4 @@ End:
vim600: syn=xml fen fdm=syntax fdl=2 si vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml vim: et tw=78 syn=sgml
vi: ts=1 sw=1 vi: ts=1 sw=1
--> -->