cvs: smarty /docs/en/appendixes tips.xml troubleshooting.xml /docs/en/designers/language-modifiers language-modifier-date-format.xml /docs/en/designers/language-variables language-variables-smarty.xml /docs/en/programmers smarty-constants.xml /docs/en/programmers/api-functions api-fetch.xml api-load-filter.xml api-register-compiler-function.xml api-register-function.xml api-register-modifier.xml api-register-object.xml api-register-outputfilter.xml api-register-postfilter.xml api-register-prefilter.xml api-template-exists.xml /docs/en/programmers/api-variables variable-autoload-filters.xml variable-cache-dir.xml variable-caching.xml variable-compile-dir.xml variable-config-dir.xml variable-debug-tpl.xml variable-php-handling.xml variable-plugins-dir.xml variable-template-dir.xml variable-use-sub-dirs.xml /docs/en/programmers/caching caching-cacheable.xml
"Nuno Lopes" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvsnlopess1117986445@cvsserver> |
nlopess Sun Jun 5 11:47:25 2005 EDT
Modified files:
/smarty/docs/en/appendixes tips.xml troubleshooting.xml
/smarty/docs/en/designers/language-modifiers
language-modifier-date-format.xml
/smarty/docs/en/designers/language-variables
language-variables-smarty.xml
/smarty/docs/en/programmers smarty-constants.xml
/smarty/docs/en/programmers/api-functions api-fetch.xml
api-load-filter.xml
api-register-compiler-function.xml
api-register-function.xml
api-register-modifier.xml
api-register-object.xml
api-register-outputfilter.xml
api-register-postfilter.xml
api-register-prefilter.xml
api-template-exists.xml
/smarty/docs/en/programmers/api-variables
variable-autoload-filters.xml
variable-cache-dir.xml
variable-caching.xml
variable-compile-dir.xml
variable-config-dir.xml
variable-debug-tpl.xml
variable-php-handling.xml
variable-plugins-dir.xml
variable-template-dir.xml
variable-use-sub-dirs.xml
/smarty/docs/en/programmers/caching caching-cacheable.xml
Log:
more examples, WS and linking from Peter. Thanks :)
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
nlopess-20050605114725.txt
(text/plain, 56.7 KB)
http://cvs.php.net/diff.php/smarty/docs/en/appendixes/tips.xml?r1=1.8&r2=1.9&ty=u
Index: smarty/docs/en/appendixes/tips.xml
diff -u smarty/docs/en/appendixes/tips.xml:1.8 smarty/docs/en/appendixes/tips.xml:1.9
--- smarty/docs/en/appendixes/tips.xml:1.8 Tue May 24 10:01:42 2005
+++ smarty/docs/en/appendixes/tips.xml Sun Jun 5 11:47:24 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.8 $ -->
+<!-- $Revision: 1.9 $ -->
<chapter id="tips">
<title>Tips & Tricks</title>
<para>
@@ -12,7 +12,9 @@
table backgrounds work properly. Many would use an
<link linkend="language.function.if">{if}</link> statement to
handle this, but there is a shorthand way with Smarty, using the
- <emphasis>default</emphasis> variable modifier.
+ <link
+ linkend="language.modifier.default"><emphasis>default</emphasis></link>
+ variable modifier.
</para>
<example>
<title>Printing &nbsp; when a variable is empty</title>
@@ -69,53 +71,71 @@
<title>Passing variable title to header template</title>
<para>
When the majority of your templates use the same headers and footers, it
- is common to split those out into their own templates and include them.
+ is common to split those out into their own templates and
+ <link linkend="language.function.include">{include}</link> them.
But what if the header needs to have a different title, depending on
what page you are coming from? You can pass the title to the header when
it is included.
</para>
- <example>
+
+ <example>
<title>Passing the title variable to the header template</title>
+
+ <para>
+ <filename>mainpage.tpl</filename>
+ </para>
<programlisting>
<![CDATA[
-mainpage.tpl
-------------
{include file="header.tpl" title="Main Page"}
{* template body goes here *}
{include file="footer.tpl"}
+]]>
+ </programlisting>
-
-archives.tpl
-------------
+ <para>
+ <filename>archives.tpl</filename>
+ </para>
+ <programlisting>
+<![CDATA[
{config_load file="archive_page.conf"}
{include file="header.tpl" title=#archivePageTitle#}
{* template body goes here *}
{include file="footer.tpl"}
+]]>
+ </programlisting>
+ <para>
+ <filename>header.tpl</filename>
+ </para>
+ <programlisting>
+<![CDATA[
+<html>
+<head>
+<title>{$title|default:"BC News"}</title>
+</head>
+<body>
+]]>
+ </programlisting>
-header.tpl
-----------
-<HTML>
-<HEAD>
-<TITLE>{$title|default:"BC News"}</TITLE>
-</HEAD>
-<BODY>
-
-
-footer.tpl
-----------
-</BODY>
-</HTML>
+ <para>
+ <filename>footer.tpl</filename>
+ </para>
+ <programlisting>
+<![CDATA[
+</body>
+</html>
]]>
</programlisting>
- </example>
+ </example>
+
<para>
When the main page is drawn, the title of "Main Page" is passed to the
- header.tpl, and will subsequently be used as the title. When the
+ <filename>header.tpl</filename>, and will subsequently be used as the title. When the
archives page is drawn, the title will be "Archives". Notice in the
- archive example, we are using a variable from the archives_page.conf
+ archive example, we are using a variable from the
+ <filename>archives_page.conf</filename>
file instead of a hard coded variable. Also notice that "BC News" is
printed if the $title variable is not set, using the
<link linkend="language.modifier.default">default</link>
@@ -191,7 +211,7 @@
$startDate = makeTimeStamp($startDate_Year, $startDate_Month, $startDate_Day);
-function makeTimeStamp($year="", $month="", $day="")
+function makeTimeStamp($year='', $month='', $day='')
{
if(empty($year)) {
$year = strftime("%Y");
@@ -222,22 +242,27 @@
<sect1 id="tips.wap">
<title>WAP/WML</title>
<para>
- WAP/WML templates require a php Content-Type header to be passed along
+ WAP/WML templates require a php
+ <ulink url="&url.php-manual;header">Content-Type header</ulink>
+ to be passed along
with the template. The easist way to do this would be to write a custom
- function that prints the header. If you are using caching, that won't
- work so we'll do it using the insert tag (remember insert tags are not
- cached!) Be sure that there is nothing output to the browser before the
+ function that prints the header. If you are using
+ <link linkend="caching">caching</link>, that won't
+ work so we'll do it using the
+ <link linkend="language.function.insert">{insert}</link>
+ tag; remember {insert} tags are not
+ cached! Be sure that there is nothing output to the browser before the
template, or else the header may fail.
</para>
<example>
- <title>using insert to write a WML Content-Type header</title>
+ <title>using {insert} to write a WML Content-Type header</title>
<programlisting role="php">
<![CDATA[
<?php
-// be sure apache is configure for the .wml extensions!
+// be sure apache is configure for the .wml extensions!
// put this function somewhere in your application, or in Smarty.addons.php
-function insert_header($params)
+function insert_header($params)
{
// this function expects $content argument
if (empty($params['content'])) {
@@ -257,27 +282,27 @@
<![CDATA[
{insert name=header content="Content-Type: text/vnd.wap.wml"}
-<?xml version="1.0"?>
-<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
+<?xml version="1.0"?>
+<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
-<!-- begin new wml deck -->
-<wml>
- <!-- begin first card -->
- <card>
- <do type="accept">
- <go href="#two"/>
- </do>
- <p>
+<!-- begin new wml deck -->
+<wml>
+ <!-- begin first card -->
+ <card>
+ <do type="accept">
+ <go href="#two"/>
+ </do>
+ <p>
Welcome to WAP with Smarty!
- Press OK to continue...
- </p>
- </card>
- <!-- begin second card -->
- <card id="two">
- <p>
+ Press OK to continue...
+ </p>
+ </card>
+ <!-- begin second card -->
+ <card id="two">
+ <p>
Pretty easy isn't it?
- </p>
- </card>
+ </p>
+ </card>
</wml>
]]>
</programlisting>
@@ -289,8 +314,8 @@
Traditionally, programming templates into your applications goes as
follows: First, you accumulate your variables within your PHP
application, (maybe with database queries.) Then, you instantiate your
- Smarty object, <link linkend="api.assign">assign</link> the variables and
- <link linkend="api.display">display</link> the template. So lets
+ Smarty object, <link linkend="api.assign">assign()</link> the variables and
+ <link linkend="api.display">display()</link> the template. So lets
say for example we have a stock ticker on our template. We would
collect the stock data in our application, then assign these variables
in the template and display it. Now wouldn't it be nice if you could
@@ -303,35 +328,39 @@
</para>
<example>
<title>componentized template</title>
+ <para>
+ <filename>function.load_ticker.php</filename> -
+ drop file in
+ <link linkend="variable.plugins.dir">$plugins directory</link>
+ </para>
<programlisting role="php">
<![CDATA[
<?php
-// drop file "function.load_ticker.php" in plugin directory
-
// setup our function for fetching stock data
-function fetch_ticker($symbol)
+function fetch_ticker($symbol)
{
// put logic here that fetches $ticker_info
// from some ticker resource
return $ticker_info;
}
-function smarty_function_load_ticker($params, &$smarty)
+function smarty_function_load_ticker($params, &$smarty)
{
// call the function
$ticker_info = fetch_ticker($params['symbol']);
-
+
// assign template variable
$smarty->assign($params['assign'], $ticker_info);
}
?>
]]>
</programlisting>
+ <para>
+ <filename>index.tpl</filename>
+ </para>
<programlisting>
<![CDATA[
-{* in index.tpl *}
-
{load_ticker symbol="YHOO" assign="ticker"}
Stock Name: {$ticker.name} Stock Price: {$ticker.price}
@@ -352,7 +381,8 @@
lists? One way spammers collect E-mail addresses is from web pages. To
help combat this problem, you can make your E-mail address show up in
scrambled javascript in the HTML source, yet it it will look and work
- correctly in the browser. This is done with the mailto plugin.
+ correctly in the browser. This is done with the
+ <link linkend="language.function.mailto">{mailto}</link> plugin.
</para>
<example>
<title>Example of Obfuscating an E-mail Address</title>
@@ -369,11 +399,13 @@
<title>Technical Note</title>
<para>
This method isn't 100% foolproof. A spammer could conceivably program his
- e-mail collector to decode these values, but not likely.
+ e-mail collector to decode these values, but not likely....hopefully.
</para>
</note>
<para>
- See also <link linkend="language.modifier.escape">escape</link>.
+ See also <link linkend="language.modifier.escape">escape</link>
+ and
+ <link linkend="language.function.mailto">{mailto}</link>.
</para>
</sect1>
</chapter>
http://cvs.php.net/diff.php/smarty/docs/en/appendixes/troubleshooting.xml?r1=1.3&r2=1.4&ty=u
Index: smarty/docs/en/appendixes/troubleshooting.xml
diff -u smarty/docs/en/appendixes/troubleshooting.xml:1.3 smarty/docs/en/appendixes/troubleshooting.xml:1.4
--- smarty/docs/en/appendixes/troubleshooting.xml:1.3 Tue May 24 10:01:42 2005
+++ smarty/docs/en/appendixes/troubleshooting.xml Sun Jun 5 11:47:24 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<chapter id="troubleshooting">
<title>Troubleshooting</title>
<para></para>
@@ -27,7 +27,7 @@
After that, the error consists of the actual line number in the Smarty
class that the error occured.
</para>
-
+
<para>
There are certain errors that Smarty cannot catch, such as missing
close tags. These types of errors usually end up in PHP compile-time
@@ -42,7 +42,7 @@
]]>
</screen>
</example>
-
+
<para>
When you encounter a PHP parsing error, the error line number will
correspond to the compiled PHP script, not the template itself. Usually
@@ -55,6 +55,110 @@
go to the line number to figure out where the corresponding error is in
the template.
</para>
+
+
+ <example>
+ <title>Other common errors</title>
+
+ <itemizedlist>
+ <listitem>
+ <screen>
+<![CDATA[
+Warning: Smarty error: unable to read resource: "index.tpl" in...
+or
+Warning: Smarty error: unable to read resource: "site.conf" in...
+]]>
+ </screen>
+ <para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ The <link linkend="variable.template.dir">$template_dir</link>
+ is incorrect, doesn't exist or
+ the file <filename>index.tpl</filename> is not in the
+ <filename class="directory">templates/</filename> directory
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ A <link linkend="language.function.config.load">{config_load}</link>
+ function is within a template (or
+ <link linkend="api.config.load">config_load()</link>
+ has been called) and either
+ <link linkend="variable.config.dir">$config_dir</link>
+ is incorrent , does not exist or
+ <filename>site.conf</filename> is not in the directory.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </para>
+
+ </listitem><listitem>
+
+ <screen>
+<![CDATA[
+Fatal error: Smarty error: the $compile_dir 'templates_c' does not exist,
+or is not a directory...
+]]>
+ </screen>
+ <para>
+ Either the
+ <link linkend="variable.compile.dir">$compile_dir</link>
+ is incorrectly set, the directory does not exist,
+ or <filename>templates_c</filename> is a
+ file and not a directory.
+ </para>
+ </listitem><listitem>
+ <screen>
+<![CDATA[
+Fatal error: Smarty error: unable to write to $compile_dir '....
+]]>
+ </screen>
+ <para>
+ The <link linkend="variable.compile.dir">$compile_dir</link>
+ is not writable by the web server. See the bottom of the
+ <link linkend="installing.smarty.basic">installing smarty</link> page
+ for permissions.
+ </para>
+
+ </listitem><listitem>
+
+ <screen>
+<![CDATA[
+Fatal error: Smarty error: the $cache_dir 'cache' does not exist,
+or is not a directory. in /..
+]]>
+ </screen>
+ <para>
+ This means that
+ <link linkend="variable.caching">$caching</link> is enabled and either;
+ the
+ <link linkend="variable.cache.dir">$cache_dir</link>
+ is incorrectly set, the directory does not exist,
+ or <filename>cache</filename> is a
+ file and not a directory.
+ </para>
+
+ </listitem><listitem>
+
+ <screen>
+<![CDATA[
+Fatal error: Smarty error: unable to write to $cache_dir '/...
+]]>
+ </screen>
+ <para>
+ This means that
+ <link linkend="variable.caching">$caching</link> is enabled and the
+ <link linkend="variable.cache.dir">$cache_dir</link>
+ is not writable by the web server. See the bottom of the
+ <link linkend="installing.smarty.basic">installing smarty</link> page
+ for permissions.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </example>
+
<para>
See also
<link linkend="chapter.debugging.console">debugging</link>,
@@ -84,3 +188,4 @@
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
+
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml?r1=1.7&r2=1.8&ty=u
Index: smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml
diff -u smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml:1.7 smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml:1.8
--- smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml:1.7 Fri May 27 12:25:01 2005
+++ smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml Sun Jun 5 11:47:24 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.7 $ -->
+<!-- $Revision: 1.8 $ -->
<sect1 id="language.modifier.date.format">
<title>date_format</title>
<informaltable frame="all">
@@ -44,9 +44,9 @@
or any string made up of month day year, parsable by
<ulink url="&url.php-manual;strtotime">strtotime()</ulink>.
Designers can then use date_format to have complete control of the
- formatting of the date. If the date passed to date_format is empty
- and a second parameter is passed, that will be used as the date to
- format.
+ formatting of the date. If the date passed to
+ <command>date_format</command> is empty and a second parameter is passed,
+ that will be used as the date to format.
</para>
<example>
<title>date_format</title>
@@ -60,7 +60,7 @@
]]>
</programlisting>
<para>
- Where template is:
+ Where template is (uses <link linkend="language.variables.smarty.now">$smarty.now</link>):
</para>
<programlisting>
<![CDATA[
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-variables/language-variables-smarty.xml?r1=1.9&r2=1.10&ty=u
Index: smarty/docs/en/designers/language-variables/language-variables-smarty.xml
diff -u smarty/docs/en/designers/language-variables/language-variables-smarty.xml:1.9 smarty/docs/en/designers/language-variables/language-variables-smarty.xml:1.10
--- smarty/docs/en/designers/language-variables/language-variables-smarty.xml:1.9 Fri May 27 12:25:01 2005
+++ smarty/docs/en/designers/language-variables/language-variables-smarty.xml Sun Jun 5 11:47:24 2005
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.9 $ -->
+<!-- $Revision: 1.10 $ -->
<sect1 id="language.variables.smarty">
<title>{$smarty} reserved variable</title>
<para>
- The reserved {$smarty} variable can be used to access several
+ The PHP reserved {$smarty} variable can be used to access several
special template variables. The full list of them follows.
</para>
@@ -12,7 +12,10 @@
<para>
The <ulink url="&url.php-manual;reserved.variables">request variables
</ulink> such as $_GET, $_POST, $_COOKIE, $_SERVER, $_ENV and $_SESSION
- can be accessed as demonstrated in the examples below:
+ (see <link linkend="variable.request.vars.order">$request_vars_order</link>
+ and <link
+ linkend="variable.request.use.auto.globals">$request_use_auto_globals</link>
+ ) can be accessed as demonstrated in the examples below:
</para>
<example>
<title>displaying request variables</title>
http://cvs.php.net/diff.php/smarty/docs/en/programmers/smarty-constants.xml?r1=1.5&r2=1.6&ty=u
Index: smarty/docs/en/programmers/smarty-constants.xml
diff -u smarty/docs/en/programmers/smarty-constants.xml:1.5 smarty/docs/en/programmers/smarty-constants.xml:1.6
--- smarty/docs/en/programmers/smarty-constants.xml:1.5 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/smarty-constants.xml Sun Jun 5 11:47:24 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
<chapter id="smarty.constants">
<title>Constants</title>
@@ -22,8 +22,9 @@
// path to Smarty windows style
define('SMARTY_DIR','c:/webroot/libs/Smarty/libs/');
-// hack that works on both under DOCUMENT _ROOT (not recommended)
-define('SMARTY-DIR',str_replace("\\","/",getcwd()).'/includes/Smarty/libs/');
+// hack (not recommended) that works on both *nix and wind
+// Smarty is assumend to be in 'includes' dir under script
+define('SMARTY_DIR',str_replace("\\","/",getcwd()).'/includes/Smarty/libs/');
// include the smarty class Note 'S' is upper case
require_once(SMARTY_DIR.'Smarty.class.php');
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-functions/api-fetch.xml?r1=1.6&r2=1.7&ty=u
Index: smarty/docs/en/programmers/api-functions/api-fetch.xml
diff -u smarty/docs/en/programmers/api-functions/api-fetch.xml:1.6 smarty/docs/en/programmers/api-functions/api-fetch.xml:1.7
--- smarty/docs/en/programmers/api-functions/api-fetch.xml:1.6 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/api-functions/api-fetch.xml Sun Jun 5 11:47:24 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
<refentry id="api.fetch">
<refnamediv>
<refname>fetch()</refname>
@@ -25,10 +25,10 @@
</para>
¶meter.compileid;
-<para>
-<example>
-<title>fetch()</title>
-<programlisting role="php">
+ <para>
+ <example>
+ <title>fetch()</title>
+ <programlisting role="php">
<![CDATA[
<?php
include('Smarty.class.php');
@@ -61,17 +61,17 @@
echo $output;
?>
]]>
-</programlisting>
-</example>
-</para>
-
-<para>
-<example>
-<title>Using fetch() to send an email</title>
- <para>
- The email_body.txt template
+ </programlisting>
+ </example>
</para>
-<programlisting>
+
+ <para>
+ <example>
+ <title>Using fetch() to send an email</title>
+ <para>
+ The email_body.tpl template
+ </para>
+ <programlisting>
<![CDATA[
Dear {$contact.name},
@@ -85,23 +85,28 @@
List master
Some user group
-{include file="email_disclaimer.txt"}
+{include file="email_disclaimer.tpl"}
]]>
-</programlisting>
- <para>
- The email_disclaimer.txt template
- </para>
-<programlisting>
+ </programlisting>
+ <para>
+ The email_disclaimer.tpl template which uses the
+ <link linkend="language.function.textformat">{textformat}</link> modifier.
+ </para>
+ <programlisting>
<![CDATA[
- This e-mail is intended for the addressee shown. It contains information
- ....... etc .......
+{textformat wrap=40}
+Unless you are named "{$contact.name}", you may read only the "odd numbered
+words" (every other word beginning with the first) of the message above. If you have
+violated that, then you hereby owe the sender 10 GBP for each even
+numbered word you have read
+{/textformat}
]]>
-</programlisting>
- <para>
- and the php script using the PHP
- <ulink url="&url.php-manual;function.mail">mail()</ulink> function
- </para>
-<programlisting role="php">
+ </programlisting>
+ <para>
+ and the php script using the PHP
+ <ulink url="&url.php-manual;function.mail">mail()</ulink> function
+ </para>
+ <programlisting role="php">
<![CDATA[
<?php
@@ -110,14 +115,13 @@
$contact = $db->getRow($sql);
$smarty->assign('contact', $contact);
-mail($contact['email'], 'Subject', $smarty->fetch('email_body.txt'));
+mail($contact['email'], 'Subject', $smarty->fetch('email_body.tpl'));
?>
]]>
-</programlisting>
-</example>
-</para>
-
+ </programlisting>
+ </example>
+ </para>
<para>
See also
@@ -150,5 +154,3 @@
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
-
-
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-functions/api-load-filter.xml?r1=1.3&r2=1.4&ty=u
Index: smarty/docs/en/programmers/api-functions/api-load-filter.xml
diff -u smarty/docs/en/programmers/api-functions/api-load-filter.xml:1.3 smarty/docs/en/programmers/api-functions/api-load-filter.xml:1.4
--- smarty/docs/en/programmers/api-functions/api-load-filter.xml:1.3 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/api-functions/api-load-filter.xml Sun Jun 5 11:47:24 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<refentry id="api.load.filter">
<refnamediv>
<refname>load_filter()</refname>
@@ -41,7 +41,8 @@
See also
<link linkend="api.register.prefilter">register_prefilter()</link>,
<link linkend="api.register.postfilter">register_postfilter()</link>,
- <link linkend="api.register.outputfilter">register_outputfilter()</link>
+ <link linkend="api.register.outputfilter">register_outputfilter()</link>,
+ <link linkend="variable.autoload.filters">$autoload_filters</link>
and
<link linkend="advanced.features">Advanced features</link>.
</para>
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-functions/api-register-compiler-function.xml?r1=1.3&r2=1.4&ty=u
Index: smarty/docs/en/programmers/api-functions/api-register-compiler-function.xml
diff -u smarty/docs/en/programmers/api-functions/api-register-compiler-function.xml:1.3 smarty/docs/en/programmers/api-functions/api-register-compiler-function.xml:1.4
--- smarty/docs/en/programmers/api-functions/api-register-compiler-function.xml:1.3 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/api-functions/api-register-compiler-function.xml Sun Jun 5 11:47:24 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<refentry id="api.register.compiler.function">
<refnamediv>
<refname>register_compiler_function()</refname>
@@ -21,24 +21,30 @@
<para>
The php-function callback <parameter>impl</parameter> can be either:
</para>
- <para>
- (a) a string containing the function name
- </para>
- <para>(b) an array of the form <literal>array(&$object, $method)</literal> with
- <literal>&$object</literal> being a reference to an
- object and <literal>$method</literal> being a string
- containing the mehod-name
- </para>
- <para>(c) an array of the form
- <literal>array(&$class, $method)</literal> with
- <literal>$class</literal> being a classname and
- <literal>$method</literal> being a class method of that
- class.
- </para>
+ <orderedlist numeration="loweralpha">
+ <listitem>
+ <para>
+ a string containing the function name
+ </para>
+ </listitem><listitem>
+ <para>an array of the form <literal>array(&$object, $method)</literal> with
+ <literal>&$object</literal> being a reference to an
+ object and <literal>$method</literal> being a string
+ containing the mehod-name
+ </para>
+ </listitem><listitem>
+ <para>an array of the form
+ <literal>array(&$class, $method)</literal> with
+ <literal>$class</literal> being a classname and
+ <literal>$method</literal> being a class method of that
+ class.
+ </para>
+ </listitem>
+ </orderedlist>
<para>
<parameter>cacheable</parameter> can be omitted in
most cases. See <link linkend="caching.cacheable">Controlling
- Cacheability of Plugins' Output</link> on how to it properly.
+ Cacheability of Plugins' Output</link> on how to use it properly.
</para>
<para>
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-functions/api-register-function.xml?r1=1.4&r2=1.5&ty=u
Index: smarty/docs/en/programmers/api-functions/api-register-function.xml
diff -u smarty/docs/en/programmers/api-functions/api-register-function.xml:1.4 smarty/docs/en/programmers/api-functions/api-register-function.xml:1.5
--- smarty/docs/en/programmers/api-functions/api-register-function.xml:1.4 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/api-functions/api-register-function.xml Sun Jun 5 11:47:24 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<refentry id="api.register.function">
<refnamediv>
<refname>register_function()</refname>
@@ -22,22 +22,29 @@
<para>
The php-function callback <parameter>impl</parameter> can be either
</para>
- <para>
- (a) a string containing the function name
+ <orderedlist numeration="loweralpha">
+ <listitem>
+ <para>
+ a string containing the function name
+ </para>
+ </listitem><listitem>
+ <para>
+ an array of the form
+ <literal>array(&$object, $method)</literal> with
+ <literal>&$object</literal> being a reference to an
+ object and <literal>$method</literal> being a string
+ containing the mehod-name
+ </para>
+ </listitem><listitem>
+ <para>
+ an array of the form <literal>array(&$class, $method)</literal>
+ with <literal>$class</literal> being a classname and
+ <literal>$method</literal> being a class method of that
+ class.
</para>
- <para>
- (b) an array of the form
- <literal>array(&$object, $method)</literal> with
- <literal>&$object</literal> being a reference to an
- object and <literal>$method</literal> being a string
- containing the mehod-name
- </para>
- <para>
- (c) an array of the form <literal>array(&$class, $method)</literal>
- with <literal>$class</literal> being a classname and
- <literal>$method</literal> being a class method of that
- class.
- </para>
+ </listitem>
+ </orderedlist>
+
<para>
<parameter>cacheable</parameter> and <parameter>cache_attrs</parameter> can be
omitted in most cases. See <link
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-functions/api-register-modifier.xml?r1=1.4&r2=1.5&ty=u
Index: smarty/docs/en/programmers/api-functions/api-register-modifier.xml
diff -u smarty/docs/en/programmers/api-functions/api-register-modifier.xml:1.4 smarty/docs/en/programmers/api-functions/api-register-modifier.xml:1.5
--- smarty/docs/en/programmers/api-functions/api-register-modifier.xml:1.4 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/api-functions/api-register-modifier.xml Sun Jun 5 11:47:24 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<refentry id="api.register.modifier">
<refnamediv>
<refname>register_modifier()</refname>
@@ -18,17 +18,30 @@
implements it.
</para>
<para>
- The php-function callback <parameter>impl</parameter> can be either (a) a string
- containing the function name or (b) an array of the form
- <literal>array(&$object, $method)</literal> with
- <literal>&$object</literal> being a reference to an
- object and <literal>$method</literal> being a string
- containing the mehod-name or (c) an array of the form
- <literal>array(&$class, $method)</literal> with
- <literal>$class</literal> being a classname and
- <literal>$method</literal> being a class method of that
- class.
+ The php-function callback <parameter>impl</parameter> can be either
</para>
+ <orderedlist numeration="loweralpha">
+ <listitem>
+ <para>a string containing the function name
+ </para>
+ </listitem><listitem>
+ <para>an array of the form <literal>array(&$object,
+ $method)</literal> with <literal>&$object</literal>
+ being a reference to an
+ object and <literal>$method</literal> being a string
+ containing the mehod-name
+ </para>
+ </listitem><listitem>
+ <para>
+ an array of the form
+ <literal>array(&$class, $method)</literal> with
+ <literal>$class</literal> being a classname and
+ <literal>$method</literal> being a class method of that
+ class.
+ </para>
+ </listitem>
+ </orderedlist>
+
<example>
<title>register_modifier()</title>
<programlisting role="php">
@@ -59,7 +72,7 @@
<link linkend="language.modifiers">modifiers</link>,
<link linkend="plugins">Extending Smarty with plugins</link>
and
- <link linkend="plugins.modifiers">Plugin modifiers</link>,
+ <link linkend="plugins.modifiers">Creating Plugin modifiers</link>,
</para>
</refsect1>
</refentry>
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-functions/api-register-object.xml?r1=1.7&r2=1.8&ty=u
Index: smarty/docs/en/programmers/api-functions/api-register-object.xml
diff -u smarty/docs/en/programmers/api-functions/api-register-object.xml:1.7 smarty/docs/en/programmers/api-functions/api-register-object.xml:1.8
--- smarty/docs/en/programmers/api-functions/api-register-object.xml:1.7 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/api-functions/api-register-object.xml Sun Jun 5 11:47:25 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.7 $ -->
+<!-- $Revision: 1.8 $ -->
<refentry id="api.register.object">
<refnamediv>
<refname>register_object()</refname>
@@ -22,7 +22,10 @@
for examples.
</para>
<para>
- See also <link linkend="api.unregister.object">unregister_object()</link>.
+ See also
+ <link linkend="api.get.registered.object">get_registered_object()</link>,
+ and
+ <link linkend="api.unregister.object">unregister_object()</link>.
</para>
</refsect1>
</refentry>
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-functions/api-register-outputfilter.xml?r1=1.3&r2=1.4&ty=u
Index: smarty/docs/en/programmers/api-functions/api-register-outputfilter.xml
diff -u smarty/docs/en/programmers/api-functions/api-register-outputfilter.xml:1.3 smarty/docs/en/programmers/api-functions/api-register-outputfilter.xml:1.4
--- smarty/docs/en/programmers/api-functions/api-register-outputfilter.xml:1.3 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/api-functions/api-register-outputfilter.xml Sun Jun 5 11:47:25 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<refentry id="api.register.outputfilter">
<refnamediv>
<refname>register_outputfilter()</refname>
@@ -23,30 +23,36 @@
<para>
The php-function callback <parameter>function</parameter> can be either
</para>
- <para>
- (a) a string
- containing the function name
- </para>
- <para>
- (b) an array of the form
- <literal>array(&$object, $method)</literal> with
- <literal>&$object</literal> being a reference to an
- object and <literal>$method</literal> being a string
- containing the mehod-name
- </para>
- <para>
- (c) an array of the form
- <literal>array(&$class, $method)</literal> with
- <literal>$class</literal> being a classname and
- <literal>$method</literal> being a class method of that
- class.
- </para>
+ <orderedlist numeration="loweralpha">
+ <listitem>
+ <para>
+ a string containing the function name
+ </para>
+ </listitem><listitem>
+ <para>
+ an array of the form
+ <literal>array(&$object, $method)</literal> with
+ <literal>&$object</literal> being a reference to an
+ object and <literal>$method</literal> being a string
+ containing the mehod-name
+ </para>
+ </listitem><listitem>
+ <para>
+ an array of the form
+ <literal>array(&$class, $method)</literal> with
+ <literal>$class</literal> being a classname and
+ <literal>$method</literal> being a class method of that
+ class.
+ </para>
+ </listitem>
+ </orderedlist>
<para>
See also
<link linkend="api.unregister.outputfilter">unregister_outputfilter()</link>,
<link linkend="api.register.prefilter">register_prefilter()</link>,
<link linkend="api.register.postfilter">register_postfilter()</link>,
<link linkend="api.load.filter">load_filter()</link>,
+<link linkend="variable.autoload.filters">$autoload_filters</link>
and
<link linkend="advanced.features.outputfilters">template
output filters</link>.
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-functions/api-register-postfilter.xml?r1=1.3&r2=1.4&ty=u
Index: smarty/docs/en/programmers/api-functions/api-register-postfilter.xml
diff -u smarty/docs/en/programmers/api-functions/api-register-postfilter.xml:1.3 smarty/docs/en/programmers/api-functions/api-register-postfilter.xml:1.4
--- smarty/docs/en/programmers/api-functions/api-register-postfilter.xml:1.3 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/api-functions/api-register-postfilter.xml Sun Jun 5 11:47:25 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<refentry id="api.register.postfilter">
<refnamediv>
<refname>register_postfilter()</refname>
@@ -20,31 +20,37 @@
</para>
<para>
The php-function callback <parameter>function</parameter> can be either
+ </para>
+ <orderedlist numeration="loweralpha">
+ <listitem>
+ <para>
+ a string containing the function name
</para>
- <para>
- (a) a string containing the function name
- </para>
- <para>
- (b) an array of the form
- <literal>array(&$object, $method)</literal> with
- <literal>&$object</literal> being a reference to an
- object and <literal>$method</literal> being a string
- containing the mehod-name
- </para>
- <para>
- (c) an array of the form
- <literal>array(&$class, $method)</literal> with
- <literal>$class</literal> being a classname and
- <literal>$method</literal> being a class method of that
- class.
- </para>
-
+ </listitem><listitem>
+ <para>
+ an array of the form
+ <literal>array(&$object, $method)</literal> with
+ <literal>&$object</literal> being a reference to an
+ object and <literal>$method</literal> being a string
+ containing the mehod-name
+ </para>
+ </listitem><listitem>
+ <para>
+ an array of the form
+ <literal>array(&$class, $method)</literal> with
+ <literal>$class</literal> being a classname and
+ <literal>$method</literal> being a class method of that
+ class.
+ </para>
+ </listitem>
+ </orderedlist>
<para>
See also
<link linkend="api.unregister.postfilter">unregister_postfilter()</link>,
<link linkend="api.register.prefilter">register_prefilter()</link>,
<link linkend="api.register.outputfilter">register_ouputfilter()</link>,
<link linkend="api.load.filter">load_filter()</link>,
+ <link linkend="variable.autoload.filters">$autoload_filters</link>
and
<link linkend="advanced.features.outputfilters">template
output filters</link>.
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-functions/api-register-prefilter.xml?r1=1.3&r2=1.4&ty=u
Index: smarty/docs/en/programmers/api-functions/api-register-prefilter.xml
diff -u smarty/docs/en/programmers/api-functions/api-register-prefilter.xml:1.3 smarty/docs/en/programmers/api-functions/api-register-prefilter.xml:1.4
--- smarty/docs/en/programmers/api-functions/api-register-prefilter.xml:1.3 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/api-functions/api-register-prefilter.xml Sun Jun 5 11:47:25 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<refentry id="api.register.prefilter">
<refnamediv>
<refname>register_prefilter()</refname>
@@ -18,37 +18,46 @@
linkend="advanced.features.prefilters">template prefilters</link> for
more information on how to setup a prefiltering function.
</para>
+
<para>
- The php-function callback <parameter>function</parameter> can be either
- </para>
- <para>
- (a) a string
- containing the function name
- </para>
- <para>
- (b) an array of the form
- <literal>array(&$object, $method)</literal> with
- <literal>&$object</literal> being a reference to an
- object and <literal>$method</literal> being a string
- containing the mehod-name
- </para>
- <para>
- (c) an array of the form
- <literal>array(&$class, $method)</literal> with
- <literal>$class</literal> being a classname and
- <literal>$method</literal> being a class method of that
- class.
+ The php-function callback <parameter>function</parameter> can be either
</para>
+ <orderedlist numeration="loweralpha">
+ <listitem>
+ <para>
+ a string containing the function name
+ </para>
+ </listitem><listitem>
+ <para>
+ an array of the form
+ <literal>array(&$object, $method)</literal> with
+ <literal>&$object</literal> being a reference to an
+ object and <literal>$method</literal> being a string
+ containing the mehod-name
+ </para>
+ </listitem><listitem>
+ <para>
+ an array of the form
+ <literal>array(&$class, $method)</literal> with
+ <literal>$class</literal> being a classname and
+ <literal>$method</literal> being a class method of that
+ class.
+ </para>
+ </listitem>
+ </orderedlist>
+
<para>
See also
<link linkend="api.unregister.prefilter">unregister_prefilter()</link>,
<link linkend="api.register.postfilter">register_postfilter()</link>,
<link linkend="api.register.outputfilter">register_ouputfilter()</link>,
<link linkend="api.load.filter">load_filter()</link>,
+ <link linkend="variable.autoload.filters">$autoload_filters</link>
and
<link linkend="advanced.features.outputfilters">template
output filters</link>.
-</para>
+ </para>
+
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-functions/api-template-exists.xml?r1=1.4&r2=1.5&ty=u
Index: smarty/docs/en/programmers/api-functions/api-template-exists.xml
diff -u smarty/docs/en/programmers/api-functions/api-template-exists.xml:1.4 smarty/docs/en/programmers/api-functions/api-template-exists.xml:1.5
--- smarty/docs/en/programmers/api-functions/api-template-exists.xml:1.4 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/api-functions/api-template-exists.xml Sun Jun 5 11:47:25 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<refentry id="api.template.exists">
<refnamediv>
<refname>template_exists()</refname>
@@ -15,6 +15,55 @@
It can accept either a path to the template on the filesystem or a
resource string specifying the template.
</para>
+
+ <example>
+ <title>template_exists()</title>
+ <para>
+ This example uses $_GET['page'] to include a content template. If
+ the template doesnt exist then an error page is displayed instead.
+ </para>
+ <para>
+ The <filename>page_container.tpl</filename>
+ </para>
+ <programlisting role="php">
+<![CDATA[
+<html>
+<head><title>{$title}</title></head>
+<body>
+{include file='page_top.tpl'}
+
+{* include middle content page *}
+{include file=$page_mid}
+
+{include file='page_footer.tpl'}
+</body>
+]]>
+ </programlisting>
+ <para>
+ and the php script
+ </para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+// set the filename eg index.inc.tpl
+$template_name = $_GET['page'].'inc.tpl';
+
+if( !smarty->template_exists($template_name) ){
+ $filename= 'page_not_found.inc.tpl';
+ }
+$smarty->assign('page_mid', $template_name);
+
+$smarty->display('page_container.tpl');
+
+?>
+]]>
+ </programlisting>
+ </example>
+
+
+
+
<para>
See also
<link linkend="api.display">display()</link>,
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-variables/variable-autoload-filters.xml?r1=1.2&r2=1.3&ty=u
Index: smarty/docs/en/programmers/api-variables/variable-autoload-filters.xml
diff -u smarty/docs/en/programmers/api-variables/variable-autoload-filters.xml:1.2 smarty/docs/en/programmers/api-variables/variable-autoload-filters.xml:1.3
--- smarty/docs/en/programmers/api-variables/variable-autoload-filters.xml:1.2 Wed Apr 14 11:53:39 2004
+++ smarty/docs/en/programmers/api-variables/variable-autoload-filters.xml Sun Jun 5 11:47:25 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<sect1 id="variable.autoload.filters">
<title>$autoload_filters</title>
<para>
@@ -17,7 +17,16 @@
?>
]]>
</programlisting>
- </informalexample>
+ </informalexample>
+ </para>
+
+ <para>
+ See also
+ <link linkend="api.register.outputfilter">register_outputfilter()</link>,
+ <link linkend="api.register.prefilter">register_prefilter()</link>,
+ <link linkend="api.register.postfilter">register_postfilter()</link>
+ and
+ <link linkend="api.load.filter">load_filter()</link>
</para>
</sect1>
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-variables/variable-cache-dir.xml?r1=1.4&r2=1.5&ty=u
Index: smarty/docs/en/programmers/api-variables/variable-cache-dir.xml
diff -u smarty/docs/en/programmers/api-variables/variable-cache-dir.xml:1.4 smarty/docs/en/programmers/api-variables/variable-cache-dir.xml:1.5
--- smarty/docs/en/programmers/api-variables/variable-cache-dir.xml:1.4 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/api-variables/variable-cache-dir.xml Sun Jun 5 11:47:25 2005
@@ -1,14 +1,16 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<sect1 id="variable.cache.dir">
<title>$cache_dir</title>
<para>
This is the name of the directory where template caches are
- stored. By default this is "./cache", meaning that it will look
- for the cache directory in the same directory as the executing
- php script.
+ stored. By default this is
+ <filename class="directory">"./cache"</filename>, meaning that
+ Smarty will look for the cache directory in the same directory
+ as the executing php script.
<emphasis role="bold">This directory must
- be writeable by the web server. </emphasis>
+ be writeable by the web server</emphasis>
+ (<link linkend="installing.smarty.basic">see install</link>).
You can also use your own
<link linkend="section.template.cache.handler.func">
custom cache handler</link>
@@ -64,3 +66,4 @@
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
+
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-variables/variable-caching.xml?r1=1.4&r2=1.5&ty=u
Index: smarty/docs/en/programmers/api-variables/variable-caching.xml
diff -u smarty/docs/en/programmers/api-variables/variable-caching.xml:1.4 smarty/docs/en/programmers/api-variables/variable-caching.xml:1.5
--- smarty/docs/en/programmers/api-variables/variable-caching.xml:1.4 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/api-variables/variable-caching.xml Sun Jun 5 11:47:25 2005
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<sect1 id="variable.caching">
<title>$caching</title>
<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
+ to the <link linkend="variable.cache.dir">$cache_dir</link>.
By default this is set to 0, or disabled. If your templates generate
redundant content, it is advisable to turn on $caching. This
will result in significant performance gains. You can also have
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-variables/variable-compile-dir.xml?r1=1.3&r2=1.4&ty=u
Index: smarty/docs/en/programmers/api-variables/variable-compile-dir.xml
diff -u smarty/docs/en/programmers/api-variables/variable-compile-dir.xml:1.3 smarty/docs/en/programmers/api-variables/variable-compile-dir.xml:1.4
--- smarty/docs/en/programmers/api-variables/variable-compile-dir.xml:1.3 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/api-variables/variable-compile-dir.xml Sun Jun 5 11:47:25 2005
@@ -1,13 +1,17 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<sect1 id="variable.compile.dir">
<title>$compile_dir</title>
<para>
This is the name of the directory where compiled templates are
- located. By default this is "./templates_c", meaning that it
+ located. By default this is
+ <filename class="directory">"./templates_c"</filename>
+ , meaning that it
will look for the compile directory in the same directory as
the executing php script. <emphasis role="bold">This directory must
- be writeable by the web server. </emphasis> See also
+ be writeable by the web server</emphasis>
+ (<link linkend="installing.smarty.basic">see install</link>).
+ Also
<link linkend="variable.use.sub.dirs">$use_sub_dirs</link>.
</para>
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-variables/variable-config-dir.xml?r1=1.2&r2=1.3&ty=u
Index: smarty/docs/en/programmers/api-variables/variable-config-dir.xml
diff -u smarty/docs/en/programmers/api-variables/variable-config-dir.xml:1.2 smarty/docs/en/programmers/api-variables/variable-config-dir.xml:1.3
--- smarty/docs/en/programmers/api-variables/variable-config-dir.xml:1.2 Mon May 23 11:43:01 2005
+++ smarty/docs/en/programmers/api-variables/variable-config-dir.xml Sun Jun 5 11:47:25 2005
@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<sect1 id="variable.config.dir">
<title>$config_dir</title>
<para>
This is the directory used to store
<link linkend="config.files">config files</link>
used in the
- templates. Default is "./configs", meaning that it will look
- for the configs directory in the same directory as the
- executing php script.
+ templates. Default is
+ <filename class="directory">"./configs"</filename>, meaning that
+ Smarty will look for the configs directory in the same directory
+ as the executing php script.
</para>
<note>
<title>Technical Note</title>
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-variables/variable-debug-tpl.xml?r1=1.2&r2=1.3&ty=u
Index: smarty/docs/en/programmers/api-variables/variable-debug-tpl.xml
diff -u smarty/docs/en/programmers/api-variables/variable-debug-tpl.xml:1.2 smarty/docs/en/programmers/api-variables/variable-debug-tpl.xml:1.3
--- smarty/docs/en/programmers/api-variables/variable-debug-tpl.xml:1.2 Mon May 23 11:43:01 2005
+++ smarty/docs/en/programmers/api-variables/variable-debug-tpl.xml Sun Jun 5 11:47:25 2005
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<sect1 id="variable.debug.tpl">
<title>$debug_tpl</title>
<para>
This is the name of the template file used for the debugging console. By
- default, it is named debug.tpl and is located in the <link
+ default, it is named <filename>debug.tpl</filename> and is
+ located in the <link
linkend="constant.smarty.dir">SMARTY_DIR</link>.
</para>
<para>
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-variables/variable-php-handling.xml?r1=1.2&r2=1.3&ty=u
Index: smarty/docs/en/programmers/api-variables/variable-php-handling.xml
diff -u smarty/docs/en/programmers/api-variables/variable-php-handling.xml:1.2 smarty/docs/en/programmers/api-variables/variable-php-handling.xml:1.3
--- smarty/docs/en/programmers/api-variables/variable-php-handling.xml:1.2 Sun Apr 18 13:23:26 2004
+++ smarty/docs/en/programmers/api-variables/variable-php-handling.xml Sun Jun 5 11:47:25 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<sect1 id="variable.php.handling">
<title>$php_handling</title>
<para>
@@ -8,7 +8,7 @@
SMARTY_PHP_PASSTHRU. Note that this does NOT affect php code
within <link linkend="language.function.php">{php}{/php}</link>
tags in the template.
- </para>
+ </para>
<itemizedlist>
<listitem><para>SMARTY_PHP_PASSTHRU - Smarty echos tags as-is.</para></listitem>
<listitem><para>SMARTY_PHP_QUOTE - Smarty quotes the tags as
@@ -21,8 +21,8 @@
<note>
<para>
Embedding PHP code into templates is highly discouraged.
- Use <link linkend="language.custom.functions">custom functions</link> or
- <link linkend="language.modifiers">modifiers</link> instead.
+ Use <link linkend="plugins.functions">custom functions</link> or
+ <link linkend="plugins.modifiers">modifiers</link> instead.
</para>
</note>
</sect1>
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-variables/variable-plugins-dir.xml?r1=1.3&r2=1.4&ty=u
Index: smarty/docs/en/programmers/api-variables/variable-plugins-dir.xml
diff -u smarty/docs/en/programmers/api-variables/variable-plugins-dir.xml:1.3 smarty/docs/en/programmers/api-variables/variable-plugins-dir.xml:1.4
--- smarty/docs/en/programmers/api-variables/variable-plugins-dir.xml:1.3 Mon May 23 11:43:01 2005
+++ smarty/docs/en/programmers/api-variables/variable-plugins-dir.xml Sun Jun 5 11:47:25 2005
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<sect1 id="variable.plugins.dir">
<title>$plugins_dir</title>
<para>
This is the directory (or directories) where Smarty will look for the
- plugins that it needs. Default is "plugins" under the
+ plugins that it needs. Default is
+ <filename class="directory">"plugins"</filename> under the
<link linkend="constant.smarty.dir">SMARTY_DIR</link>. If you
supply a relative path, Smarty will first look under the
<link linkend="constant.smarty.dir">SMARTY_DIR</link>, then
@@ -13,14 +14,33 @@
search for your plugin in each plugin directory in the order they are
given.
</para>
- <note>
- <title>Technical Note</title>
- <para>
- For best performance, do not setup your plugins_dir to have to use the
- PHP include path. Use an absolute pathname, or a path relative to
- SMARTY_DIR or the cwd.
- </para>
- </note>
+ <note>
+ <title>Technical Note</title>
+ <para>
+ For best performance, do not setup your $plugins_dir to have to use
+ the PHP include path. Use an absolute pathname, or a path relative
+ to SMARTY_DIR or the cwd.
+ </para>
+ </note>
+
+ <example>
+ <title>multiple $plugins_dir</title>
+ <programlisting role="php">
+<![CDATA[
+<?php
+
+$smarty->plugins_dir = array(
+ 'plugins', // the default under SMARTY_DIR
+ '/path/to/shared/plugins',
+ '../../includes/my/plugins'
+ );
+
+?>
+
+]]>
+ </programlisting>
+ </example>
+
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-variables/variable-template-dir.xml?r1=1.1&r2=1.2&ty=u
Index: smarty/docs/en/programmers/api-variables/variable-template-dir.xml
diff -u smarty/docs/en/programmers/api-variables/variable-template-dir.xml:1.1 smarty/docs/en/programmers/api-variables/variable-template-dir.xml:1.2
--- smarty/docs/en/programmers/api-variables/variable-template-dir.xml:1.1 Tue Apr 13 07:39:15 2004
+++ smarty/docs/en/programmers/api-variables/variable-template-dir.xml Sun Jun 5 11:47:25 2005
@@ -1,13 +1,16 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
+<!-- $Revision: 1.2 $ -->
<sect1 id="variable.template.dir">
<title>$template_dir</title>
<para>
This is the name of the default template directory. If you do
not supply a resource type when including files, they will be
- found here. By default this is "./templates", meaning that it
- will look for the templates directory in the same directory as
- the executing php script.
+ found here. By default this is
+ <filename class="directory">"./templates"</filename>,
+ meaning that Smarty
+ will look for the
+ <filename class="directory">templates</filename> directory in
+ the same directory as the executing php script.
</para>
<note>
<title>Technical Note</title>
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-variables/variable-use-sub-dirs.xml?r1=1.3&r2=1.4&ty=u
Index: smarty/docs/en/programmers/api-variables/variable-use-sub-dirs.xml
diff -u smarty/docs/en/programmers/api-variables/variable-use-sub-dirs.xml:1.3 smarty/docs/en/programmers/api-variables/variable-use-sub-dirs.xml:1.4
--- smarty/docs/en/programmers/api-variables/variable-use-sub-dirs.xml:1.3 Fri May 27 12:25:02 2005
+++ smarty/docs/en/programmers/api-variables/variable-use-sub-dirs.xml Sun Jun 5 11:47:25 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<sect1 id="variable.use.sub.dirs">
<title>$use_sub_dirs</title>
<para>
@@ -23,8 +23,9 @@
<note>
<title>Technical Note</title>
<para>
-$use_sub_dirs=true doesn't work with safe_mode=On, that's why it's
-switchable and why it's off by default.
+$use_sub_dirs=true doesn't work with
+<ulink url="&url.php-manual;features.safe-mode">safe_mode=On</ulink>,
+that's why it's switchable and why it's off by default.
</para>
</note>
<note>
http://cvs.php.net/diff.php/smarty/docs/en/programmers/caching/caching-cacheable.xml?r1=1.6&r2=1.7&ty=u
Index: smarty/docs/en/programmers/caching/caching-cacheable.xml
diff -u smarty/docs/en/programmers/caching/caching-cacheable.xml:1.6 smarty/docs/en/programmers/caching/caching-cacheable.xml:1.7
--- smarty/docs/en/programmers/caching/caching-cacheable.xml:1.6 Wed Jan 5 09:37:31 2005
+++ smarty/docs/en/programmers/caching/caching-cacheable.xml Sun Jun 5 11:47:25 2005
@@ -1,29 +1,34 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.6 $ -->
+<!-- $Revision: 1.7 $ -->
<sect1 id="caching.cacheable">
<title>Controlling Cacheability of Plugins' Output</title>
- <para>
+ <para>
Since Smarty-2.6.0 plugins the cacheability of plugins can be declared
- when registering them. The third parameter to register_block,
- register_compiler_function and register_function is called
+ when registering them. The third parameter to
+ <link linkend="api.register.block">register_block()</link>,
+ <link
+ linkend="api.register.compiler.function">register_compiler_function()
+ </link> and
+ <link linkend="api.register.block">register_function()</link> is called
<parameter>$cacheable</parameter> and defaults to true which is also
the behaviour of plugins in Smarty versions before 2.6.0
</para>
+
<para>
- When registering a plugin with $cacheable=false the plugin is
+ When registering a plugin with $cacheable=false the plugin is
called everytime the page is displayed, even if the page comes
from the cache. The plugin function behaves a little like an
<link linkend="plugins.inserts">insert</link> function.
</para>
<para>
- In contrast to <link linkend="language.function.insert">{insert}</link>
+ In contrast to <link linkend="plugins.inserts">insert</link>
the attributes to the plugins are not cached by default. They can be
- declared to be cached with the fourth parameter
+ declared to be cached with the fourth parameter
<parameter>$cache_attrs</parameter>. <parameter>$cache_attrs</parameter>
- is an array of attribute-names that should be cached, so the
- plugin-function get value as it was the time the page was written
+ is an array of attribute-names that should be cached, so the
+ plugin-function get value as it was the time the page was written
to cache everytime it is fetched from the cache.
</para>
@@ -65,7 +70,7 @@
</programlisting>
<para>
The number of seconds till the endtime of $obj is reached changes on
- each display of the page, even if the page is cached. Since the
+ each display of the page, even if the page is cached. Since the
endtime attribute is cached the object only has to be pulled from the
database when page is written to the cache but not on subsequent requests
of the page.
@@ -109,16 +114,16 @@
]]>
</programlisting>
</example>
-
+
<para>
When reloading the page you will notice that both dates differ. One
- is "dynamic" one is "static". You can do everything between
+ is "dynamic" one is "static". You can do everything between
{dynamic}...{/dynamic} and be sure it will not be cached like the rest
of the page.
</para>
-
+
</sect1>
-
+
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml