changed doc structure a bit

This commit is contained in:
mohrt
2002-04-24 14:46:02 +00:00
parent a7cee3b2a3
commit 20cb65fdb8
5 changed files with 135 additions and 127 deletions

View File

@@ -1546,7 +1546,7 @@ function _run_insert_handler($args)
// cache expired, regenerate // cache expired, regenerate
return false; return false;
} }
} elseif ($this->caching == 1) { } else {
// caching by lifetime // caching by lifetime
if ($this->cache_lifetime > -1 && (time() - $this->_cache_info['timestamp'] > $this->cache_lifetime)) { if ($this->cache_lifetime > -1 && (time() - $this->_cache_info['timestamp'] > $this->cache_lifetime)) {
// cache expired, regenerate // cache expired, regenerate

View File

@@ -1,12 +1,18 @@
{* Smarty *} {* Smarty *}
{* debug.tpl, last updated version 1.4.6 *} {* debug.tpl, last updated version 2.0.1 *}
{assign_debug_info} {assign_debug_info}
<SCRIPT language=javascript> <SCRIPT language=javascript>
_smarty_console = window.open("","console","width=560,height=600,resizable,scrollbars=yes"); if( self.name == '' ) {ldelim}
_smarty_console.document.write("<HTML><TITLE>Smarty Debug Console</TITLE><BODY bgcolor=#ffffff>"); var title = 'Console';
{rdelim}
else {ldelim}
var title = 'Console_' + self.name;
{rdelim}
_smarty_console = window.open("",title.value,"width=680,height=600,resizable,scrollbars=yes");
_smarty_console.document.write("<HTML><TITLE>Smarty Debug Console_"+self.name+"</TITLE><BODY bgcolor=#ffffff>");
_smarty_console.document.write("<table border=0 width=100%>"); _smarty_console.document.write("<table border=0 width=100%>");
_smarty_console.document.write("<tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr>"); _smarty_console.document.write("<tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr>");
_smarty_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>included templates & config files (load time in seconds):</b></td></tr>"); _smarty_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>included templates & config files (load time in seconds):</b></td></tr>");

View File

@@ -1,12 +1,9 @@
<part id="smarty.for.programmersr"> <part id="smarty.for.programmersr">
<title>Smarty For Programmers</title> <title>Smarty For Programmers</title>
<chapter id="api"> <chapter id="api.variables">
<title>Smarty API</title>
<sect1 id="api.variables">
<title>Variables</title> <title>Variables</title>
<sect2 id="variable.template.dir"> <sect1 id="variable.template.dir">
<title>$template_dir</title> <title>$template_dir</title>
<para> <para>
This is the name of the default template directory. If you do This is the name of the default template directory. If you do
@@ -22,8 +19,8 @@
the web server document root. the web server document root.
</para> </para>
</note> </note>
</sect2> </sect1>
<sect2 id="variable.compile.dir"> <sect1 id="variable.compile.dir">
<title>$compile_dir</title> <title>$compile_dir</title>
<para> <para>
This is the name of the directory where compiled templates are This is the name of the directory where compiled templates are
@@ -46,8 +43,8 @@
the web server document root. the web server document root.
</para> </para>
</note> </note>
</sect2> </sect1>
<sect2 id="variable.config.dir"> <sect1 id="variable.config.dir">
<title>$config_dir</title> <title>$config_dir</title>
<para> <para>
This is the directory used to store config files used in the This is the directory used to store config files used in the
@@ -62,8 +59,8 @@
the web server document root. the web server document root.
</para> </para>
</note> </note>
</sect2> </sect1>
<sect2 id="variable.plugins.dir"> <sect1 id="variable.plugins.dir">
<title>$plugins_dir</title> <title>$plugins_dir</title>
<para> <para>
This is the directory where Smarty will look for the plugins that This is the directory where Smarty will look for the plugins that
@@ -71,8 +68,8 @@
Smarty itself is installed. Default is "plugins". There can be Smarty itself is installed. Default is "plugins". There can be
only one plugins directory. only one plugins directory.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.debugging"> <sect1 id="variable.debugging">
<title>$debugging</title> <title>$debugging</title>
<para> <para>
This enables the <link This enables the <link
@@ -84,8 +81,8 @@
<para> <para>
NOTE: This was added to Smarty 1.4.3. NOTE: This was added to Smarty 1.4.3.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.debug.tpl"> <sect1 id="variable.debug.tpl">
<title>$debug_tpl</title> <title>$debug_tpl</title>
<para> <para>
This is the name of the template file used for the debugging This is the name of the template file used for the debugging
@@ -94,8 +91,8 @@
<para> <para>
NOTE: This was added to Smarty 1.4.3. NOTE: This was added to Smarty 1.4.3.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.debugging.ctrl"> <sect1 id="variable.debugging.ctrl">
<title>$debugging_ctrl</title> <title>$debugging_ctrl</title>
<para> <para>
This allows alternate ways to enable debugging. NONE means no This allows alternate ways to enable debugging. NONE means no
@@ -107,8 +104,8 @@
<para> <para>
NOTE: This was added to Smarty 1.4.4. NOTE: This was added to Smarty 1.4.4.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.global.assign"> <sect1 id="variable.global.assign">
<title>$global_assign</title> <title>$global_assign</title>
<para> <para>
This is a list of variables that are always implicitly assigned This is a list of variables that are always implicitly assigned
@@ -130,16 +127,16 @@
<link linkend="language.variables.smarty">$smarty</link> variable. <link linkend="language.variables.smarty">$smarty</link> variable.
</para> </para>
</note> </note>
</sect2> </sect1>
<sect2 id="variable.undefined"> <sect1 id="variable.undefined">
<title>$undefined</title> <title>$undefined</title>
<para> <para>
This sets the value of $undefined for Smarty, default is null. This sets the value of $undefined for Smarty, default is null.
Currently this is only used to set undefined variables in Currently this is only used to set undefined variables in
$global_assign to a default value. $global_assign to a default value.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.compile.check"> <sect1 id="variable.compile.check">
<title>$compile_check</title> <title>$compile_check</title>
<para> <para>
Upon each invocation of the PHP application, Smarty tests to Upon each invocation of the PHP application, Smarty tests to
@@ -159,8 +156,8 @@
linkend="variable.force.compile">$force_compile</link> or <link linkend="variable.force.compile">$force_compile</link> or <link
linkend="api.clear.compiled.tpl">clear_compiled_tpl</link>. linkend="api.clear.compiled.tpl">clear_compiled_tpl</link>.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.force.compile"> <sect1 id="variable.force.compile">
<title>$force_compile</title> <title>$force_compile</title>
<para> <para>
This forces Smarty to (re)compile templates on every This forces Smarty to (re)compile templates on every
@@ -169,8 +166,8 @@
It should never be used in a production environment. If caching It should never be used in a production environment. If caching
is enabled, the cache file(s) will be regenerated every time. is enabled, the cache file(s) will be regenerated every time.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.caching"> <sect1 id="variable.caching">
<title>$caching</title> <title>$caching</title>
<para> <para>
This tells Smarty whether or not to cache the output of the templates. This tells Smarty whether or not to cache the output of the templates.
@@ -186,13 +183,13 @@
linkend="api.is.cached">is_cached</link>. linkend="api.is.cached">is_cached</link>.
</para> </para>
<para> <para>
If $compile_check is enabled, the cached content will be If $compile_check is enabled, the cached content will be regenerated if
regenerated if any of the involved templates are changed. (new any of the templates or config files that are part of this cache are
to 1.4.6). If $force_compile is enabled, the cached content changed. If $force_compile is enabled, the cached content will always be
will always be regenerated. (added to Smarty 1.4.7) regenerated.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.cache.dir"> <sect1 id="variable.cache.dir">
<title>$cache_dir</title> <title>$cache_dir</title>
<para> <para>
This is the name of the directory where template caches are This is the name of the directory where template caches are
@@ -216,8 +213,8 @@
the web server document root. the web server document root.
</para> </para>
</note> </note>
</sect2> </sect1>
<sect2 id="variable.cache.lifetime"> <sect1 id="variable.cache.lifetime">
<title>$cache_lifetime</title> <title>$cache_lifetime</title>
<para> <para>
This is the length of time in seconds that a template cache is valid. This is the length of time in seconds that a template cache is valid.
@@ -230,16 +227,16 @@
better off setting caching=false.) If $caching = 2, then the cache better off setting caching=false.) If $caching = 2, then the cache
expiration time is saved along with the template. expiration time is saved along with the template.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.cache.handler.func"> <sect1 id="variable.cache.handler.func">
<title>$cache_handler_func</title> <title>$cache_handler_func</title>
<para> <para>
You can supply a custom function to handle cache files instead You can supply a custom function to handle cache files instead
of using the built-in method using the $cache_dir. See the of using the built-in method using the $cache_dir. See the
custom cache handler function section for details. custom cache handler function section for details.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.cache.modified.check"> <sect1 id="variable.cache.modified.check">
<title>$cache_modified_check</title> <title>$cache_modified_check</title>
<para> <para>
If set to true, Smarty will respect the If-Modified-Since If set to true, Smarty will respect the If-Modified-Since
@@ -248,15 +245,15 @@
header will be sent instead of the content. This works only on header will be sent instead of the content. This works only on
cached content without <command>insert</command> tags. cached content without <command>insert</command> tags.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.default.template.handler.func"> <sect1 id="variable.default.template.handler.func">
<title>$default_template_handler_func</title> <title>$default_template_handler_func</title>
<para> <para>
This function is called when a template cannot be obtained from This function is called when a template cannot be obtained from
its resource. (added to Smarty 1.5.2) its resource. (added to Smarty 1.5.2)
</para> </para>
</sect2> </sect1>
<sect2 id="variable.php.handling"> <sect1 id="variable.php.handling">
<title>$php_handling</title> <title>$php_handling</title>
<para> <para>
This tells Smarty how to handle PHP code embedded in the This tells Smarty how to handle PHP code embedded in the
@@ -279,8 +276,8 @@
Use <link linkend="language.custom.functions">custom functions</link> or Use <link linkend="language.custom.functions">custom functions</link> or
<link linkend="language.modifiers">modifiers</link> instead. <link linkend="language.modifiers">modifiers</link> instead.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.security"> <sect1 id="variable.security">
<title>$security</title> <title>$security</title>
<para> <para>
$security true/false, default is false. Security is good for $security true/false, default is false. Security is good for
@@ -306,15 +303,15 @@
<para> <para>
NOTE: Security features were added to Smarty 1.4.3. NOTE: Security features were added to Smarty 1.4.3.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.secure.dir"> <sect1 id="variable.secure.dir">
<title>$secure_dir</title> <title>$secure_dir</title>
<para> <para>
This is an array of all local directories that are considered This is an array of all local directories that are considered
secure. {include} and {fetch} use this when security is enabled. secure. {include} and {fetch} use this when security is enabled.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.security.settings"> <sect1 id="variable.security.settings">
<title>$security_settings</title> <title>$security_settings</title>
<para> <para>
These are used to override or specify the security settings when These are used to override or specify the security settings when
@@ -333,8 +330,8 @@
<listitem><para>MODIFIER_FUNCS - This is an array of the names of permitted <listitem><para>MODIFIER_FUNCS - This is an array of the names of permitted
PHP functions used as variable modifiers.</para></listitem> PHP functions used as variable modifiers.</para></listitem>
</itemizedlist> </itemizedlist>
</sect2> </sect1>
<sect2 id="variable.trusted.dir"> <sect1 id="variable.trusted.dir">
<title>$trusted_dir</title> <title>$trusted_dir</title>
<para> <para>
$trusted_dir is only for use when $security is enabled. This is an array $trusted_dir is only for use when $security is enabled. This is an array
@@ -342,63 +339,63 @@
where you keep php scripts that are executed directly from the templates where you keep php scripts that are executed directly from the templates
with <link linkend="language.function.include.php">{include_php}</link>. with <link linkend="language.function.include.php">{include_php}</link>.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.left.delimiter"> <sect1 id="variable.left.delimiter">
<title>$left_delimiter</title> <title>$left_delimiter</title>
<para> <para>
This is the left delimiter used by the template language. This is the left delimiter used by the template language.
Default is "{". Default is "{".
</para> </para>
</sect2> </sect1>
<sect2 id="variable.right.delimiter"> <sect1 id="variable.right.delimiter">
<title>$right_delimiter</title> <title>$right_delimiter</title>
<para> <para>
This is the right delimiter used by the template language. This is the right delimiter used by the template language.
Default is "}". Default is "}".
</para> </para>
</sect2> </sect1>
<sect2 id="variable.show.info.header"> <sect1 id="variable.show.info.header">
<title>$show_info_header</title> <title>$show_info_header</title>
<para> <para>
Shows an HTML comment at the beginning of the templates output, Shows an HTML comment at the beginning of the templates output,
displaying smarty version and date generated. Default is false. displaying smarty version and date generated. Default is false.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.show.info.include"> <sect1 id="variable.show.info.include">
<title>$show_info_include</title> <title>$show_info_include</title>
<para> <para>
Shows an HTML comment before and after each included template. Shows an HTML comment before and after each included template.
Default is false. Default is false.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.compiler.class"> <sect1 id="variable.compiler.class">
<title>$compiler_class</title> <title>$compiler_class</title>
<para> <para>
Specifies the name of the compiler class that Smarty will use Specifies the name of the compiler class that Smarty will use
to compile the templates. The default is 'Smarty_Compiler'. For to compile the templates. The default is 'Smarty_Compiler'. For
advanced users only. advanced users only.
</para> </para>
</sect2> </sect1>
<sect2 id="variable.request.vars.order"> <sect1 id="variable.request.vars.order">
<title>$request_vars_order</title> <title>$request_vars_order</title>
<para> <para>
The order in which request variables are registered, similar to The order in which request variables are registered, similar to
variables_order in php.ini variables_order in php.ini
</para> </para>
</sect2> </sect1>
<sect2 id="variable.compile.id"> <sect1 id="variable.compile.id">
<title>$compile_id</title> <title>$compile_id</title>
<para> <para>
Persistant compile identifier. As an alternative to passing the Persistant compile identifier. As an alternative to passing the
same compile_id to each and every function call, you can set this same compile_id to each and every function call, you can set this
compile_id and it will be used implicitly thereafter. compile_id and it will be used implicitly thereafter.
</para> </para>
</sect2> </sect1>
</sect1> </chapter>
<sect1 id="api.functions"> <chapter id="api.functions">
<title>Methods</title> <title>Methods</title>
<sect2 id="api.assign"> <sect1 id="api.assign">
<title>assign</title> <title>assign</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -426,8 +423,8 @@ $smarty->assign("Address",$address);
// passing an associative array // passing an associative array
$smarty->assign(array("city" => "Lincoln","state" => "Nebraska"));</programlisting> $smarty->assign(array("city" => "Lincoln","state" => "Nebraska"));</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.append"> <sect1 id="api.append">
<title>append</title> <title>append</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -455,8 +452,8 @@ $smarty->append("Address",$address);
// passing an associative array // passing an associative array
$smarty->append(array("city" => "Lincoln","state" => "Nebraska"));</programlisting> $smarty->append(array("city" => "Lincoln","state" => "Nebraska"));</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.clear.assign"> <sect1 id="api.clear.assign">
<title>clear_assign</title> <title>clear_assign</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -478,8 +475,8 @@ $smarty->clear_assign("Name");
// clear multiple variables // clear multiple variables
$smarty->clear_assign(array("Name","Address","Zip"));</programlisting> $smarty->clear_assign(array("Name","Address","Zip"));</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.clear.all.assign"> <sect1 id="api.clear.all.assign">
<title>clear_all_assign</title> <title>clear_all_assign</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -496,8 +493,8 @@ $smarty->clear_assign(array("Name","Address","Zip"));</programlisting>
// clear all assigned variables // clear all assigned variables
$smarty->clear_all_assign();</programlisting> $smarty->clear_all_assign();</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.clear.cache"> <sect1 id="api.clear.cache">
<title>clear_cache</title> <title>clear_cache</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -522,8 +519,8 @@ $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");</programlisting> $smarty->clear_cache("index.tpl","CACHEID");</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.clear.all.cache"> <sect1 id="api.clear.all.cache">
<title>clear_all_cache</title> <title>clear_all_cache</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -541,8 +538,8 @@ $smarty->clear_cache("index.tpl","CACHEID");</programlisting>
// clear the entire cache // clear the entire cache
$smarty->clear_all_cache();</programlisting> $smarty->clear_all_cache();</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.clear.compiled.tpl"> <sect1 id="api.clear.compiled.tpl">
<title>clear_compiled_tpl</title> <title>clear_compiled_tpl</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -564,8 +561,8 @@ $smarty->clear_compiled_tpl("index.tpl");
// clear entire compile directory // clear entire compile directory
$smarty->clear_compiled_tpl();</programlisting> $smarty->clear_compiled_tpl();</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.register.function"> <sect1 id="api.register.function">
<title>register_function</title> <title>register_function</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -594,8 +591,8 @@ function print_current_date ($params) {
// 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.</programlisting> // or, {date_now format="%Y/%m/%d"} to format it.</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.unregister.function"> <sect1 id="api.unregister.function">
<title>unregister_function</title> <title>unregister_function</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -614,8 +611,8 @@ function print_current_date ($params) {
$smarty->unregister_function("fetch");</programlisting> $smarty->unregister_function("fetch");</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.register.modifier"> <sect1 id="api.register.modifier">
<title>register_modifier</title> <title>register_modifier</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -638,8 +635,8 @@ $smarty->register_modifier("sslash","stripslashes");
// now you can use {$var|sslash} to strip slashes from variables</programlisting> // now you can use {$var|sslash} to strip slashes from variables</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.unregister.modifier"> <sect1 id="api.unregister.modifier">
<title>unregister_modifier</title> <title>unregister_modifier</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -658,8 +655,8 @@ $smarty->register_modifier("sslash","stripslashes");
$smarty->unregister_modifier("strip_tags");</programlisting> $smarty->unregister_modifier("strip_tags");</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.register.resource"> <sect1 id="api.register.resource">
<title>register_resource</title> <title>register_resource</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -684,8 +681,8 @@ $smarty->register_resource("db", array("db_get_template",
"db_get_secure", "db_get_secure",
"db_get_trusted"));</programlisting> "db_get_trusted"));</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.unregister.resource"> <sect1 id="api.unregister.resource">
<title>unregister_resource</title> <title>unregister_resource</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -702,8 +699,8 @@ $smarty->register_resource("db", array("db_get_template",
<programlisting> <programlisting>
$smarty->unregister_resource("db");</programlisting> $smarty->unregister_resource("db");</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.register.prefilter"> <sect1 id="api.register.prefilter">
<title>register_prefilter</title> <title>register_prefilter</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -717,8 +714,8 @@ $smarty->unregister_resource("db");</programlisting>
linkend="advanced.features.prefilters">template prefilters</link> for linkend="advanced.features.prefilters">template prefilters</link> for
more information on how to setup a prefiltering function. more information on how to setup a prefiltering function.
</para> </para>
</sect2> </sect1>
<sect2 id="api.unregister.prefilter"> <sect1 id="api.unregister.prefilter">
<title>unregister_prefilter</title> <title>unregister_prefilter</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -729,8 +726,8 @@ $smarty->unregister_resource("db");</programlisting>
<para> <para>
Use this to dynamically unregister a prefilter. Use this to dynamically unregister a prefilter.
</para> </para>
</sect2> </sect1>
<sect2 id="api.register.postfilter"> <sect1 id="api.register.postfilter">
<title>register_postfilter</title> <title>register_postfilter</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -744,8 +741,8 @@ $smarty->unregister_resource("db");</programlisting>
linkend="advanced.features.postfilters">template postfilters</link> for linkend="advanced.features.postfilters">template postfilters</link> for
more information on how to setup a postfiltering function. more information on how to setup a postfiltering function.
</para> </para>
</sect2> </sect1>
<sect2 id="api.unregister.postfilter"> <sect1 id="api.unregister.postfilter">
<title>unregister_postfilter</title> <title>unregister_postfilter</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -756,8 +753,8 @@ $smarty->unregister_resource("db");</programlisting>
<para> <para>
Use this to dynamically unregister a postfilter. Use this to dynamically unregister a postfilter.
</para> </para>
</sect2> </sect1>
<sect2 id="api.register.compiler.function"> <sect1 id="api.register.compiler.function">
<title>register_compiler_function</title> <title>register_compiler_function</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -771,8 +768,8 @@ $smarty->unregister_resource("db");</programlisting>
Pass in the compiler function name, followed by the PHP Pass in the compiler function name, followed by the PHP
function that implements it. function that implements it.
</para> </para>
</sect2> </sect1>
<sect2 id="api.unregister.compiler.function"> <sect1 id="api.unregister.compiler.function">
<title>unregister_compiler_function</title> <title>unregister_compiler_function</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -784,8 +781,8 @@ $smarty->unregister_resource("db");</programlisting>
Use this to dynamically unregister a compiler function. Pass in Use this to dynamically unregister a compiler function. Pass in
the name of the compiler function. the name of the compiler function.
</para> </para>
</sect2> </sect1>
<sect2 id="api.trigger.error"> <sect1 id="api.trigger.error">
<title>trigger_error</title> <title>trigger_error</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -801,9 +798,9 @@ $smarty->unregister_resource("db");</programlisting>
E_USER_WARNING, etc. By default it's E_USER_WARNING. This function E_USER_WARNING, etc. By default it's E_USER_WARNING. This function
was added to Smarty 2.0. was added to Smarty 2.0.
</para> </para>
</sect2> </sect1>
<sect2 id="api.is.cached"> <sect1 id="api.is.cached">
<title>is_cached</title> <title>is_cached</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -844,8 +841,8 @@ if(!$smarty->is_cached("index.tpl","FrontPage")) {
$smarty->display("index.tpl","FrontPage");</programlisting> $smarty->display("index.tpl","FrontPage");</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.get.template.vars"> <sect1 id="api.get.template.vars">
<title>get_template_vars</title> <title>get_template_vars</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -865,8 +862,8 @@ $tpl_vars = $smarty->get_template_vars();
// take a look at them // take a look at them
var_dump($tpl_vars);</programlisting> var_dump($tpl_vars);</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.display"> <sect1 id="api.display">
<title>display</title> <title>display</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -938,8 +935,8 @@ $smarty->display("file:C:/www/pub/templates/header.tpl");
$smarty->display("db:header.tpl");</programlisting> $smarty->display("db:header.tpl");</programlisting>
</example> </example>
</sect2> </sect1>
<sect2 id="api.fetch"> <sect1 id="api.fetch">
<title>fetch</title> <title>fetch</title>
<funcsynopsis> <funcsynopsis>
<funcprototype> <funcprototype>
@@ -996,9 +993,8 @@ $output = $smarty->fetch("index.tpl");
echo $output;</programlisting> echo $output;</programlisting>
</example> </example>
</sect2> </sect1>
</sect1> </chapter>
</chapter>
<chapter id="advanced.features"> <chapter id="advanced.features">
<title>Advanced Features</title> <title>Advanced Features</title>
@@ -1570,7 +1566,7 @@ function smarty_function_eightball($params, &amp;$smarty)
$answers = array('Yes', $answers = array('Yes',
'No', 'No',
'No way', 'No way',
'Outlook no so good', 'Outlook not so good',
'Ask again soon', 'Ask again soon',
'Maybe in your reality'); 'Maybe in your reality');

View File

@@ -1546,7 +1546,7 @@ function _run_insert_handler($args)
// cache expired, regenerate // cache expired, regenerate
return false; return false;
} }
} elseif ($this->caching == 1) { } else {
// caching by lifetime // caching by lifetime
if ($this->cache_lifetime > -1 && (time() - $this->_cache_info['timestamp'] > $this->cache_lifetime)) { if ($this->cache_lifetime > -1 && (time() - $this->_cache_info['timestamp'] > $this->cache_lifetime)) {
// cache expired, regenerate // cache expired, regenerate

View File

@@ -1,12 +1,18 @@
{* Smarty *} {* Smarty *}
{* debug.tpl, last updated version 1.4.6 *} {* debug.tpl, last updated version 2.0.1 *}
{assign_debug_info} {assign_debug_info}
<SCRIPT language=javascript> <SCRIPT language=javascript>
_smarty_console = window.open("","console","width=560,height=600,resizable,scrollbars=yes"); if( self.name == '' ) {ldelim}
_smarty_console.document.write("<HTML><TITLE>Smarty Debug Console</TITLE><BODY bgcolor=#ffffff>"); var title = 'Console';
{rdelim}
else {ldelim}
var title = 'Console_' + self.name;
{rdelim}
_smarty_console = window.open("",title.value,"width=680,height=600,resizable,scrollbars=yes");
_smarty_console.document.write("<HTML><TITLE>Smarty Debug Console_"+self.name+"</TITLE><BODY bgcolor=#ffffff>");
_smarty_console.document.write("<table border=0 width=100%>"); _smarty_console.document.write("<table border=0 width=100%>");
_smarty_console.document.write("<tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr>"); _smarty_console.document.write("<tr bgcolor=#cccccc><th colspan=2>Smarty Debug Console</th></tr>");
_smarty_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>included templates & config files (load time in seconds):</b></td></tr>"); _smarty_console.document.write("<tr bgcolor=#cccccc><td colspan=2><b>included templates & config files (load time in seconds):</b></td></tr>");