mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
convert technical notes to docbook format
This commit is contained in:
@@ -385,11 +385,14 @@ href="mailto:%62%6f%62%40%6d%65%2e%6e%65%74">bob&a
|
|||||||
correctly in your browser, and the mailto: hyperlink will go to the correct
|
correctly in your browser, and the mailto: hyperlink will go to the correct
|
||||||
address.
|
address.
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: This method isn't 100% foolproof. Although highly unlikely,
|
This method isn't 100% foolproof. Although highly unlikely,
|
||||||
a spammer could conceivably write his e-mail collecter to decode these
|
a spammer could conceivably write his e-mail collecter to decode these
|
||||||
values.
|
values.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
</sect1>
|
</sect1>
|
||||||
</chapter>
|
</chapter>
|
||||||
<chapter id="resources">
|
<chapter id="resources">
|
||||||
|
@@ -1697,14 +1697,17 @@ index.tpl
|
|||||||
can reference and modify information in the Smarty object from
|
can reference and modify information in the Smarty object from
|
||||||
within the insert function. (added in 1.4.5)
|
within the insert function. (added in 1.4.5)
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: It is possible to have portions of the template not
|
It is possible to have portions of the template not
|
||||||
cached. If you have <link linkend="features.caching">caching</link>
|
cached. If you have <link linkend="features.caching">caching</link>
|
||||||
turned on, insert tags will not be cached. They will run
|
turned on, insert tags will not be cached. They will run
|
||||||
dynamically every time the page is created, even within cached
|
dynamically every time the page is created, even within cached
|
||||||
pages. This works good for things like banners, polls, live
|
pages. This works good for things like banners, polls, live
|
||||||
weather, search results, user feedback areas, etc.
|
weather, search results, user feedback areas, etc.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="language.function.if">
|
<sect2 id="language.function.if">
|
||||||
<title>if,elseif,else</title>
|
<title>if,elseif,else</title>
|
||||||
@@ -2108,11 +2111,14 @@ e-mail: jane@mydomain.com<p></programlisting>
|
|||||||
(or the start attribute if given), and incrementing by one (or by
|
(or the start attribute if given), and incrementing by one (or by
|
||||||
the step attribute if given.)
|
the step attribute if given.)
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: If the step and start section properties are not
|
If the step and start section properties are not
|
||||||
modified, then this works the same as the iteration section
|
modified, then this works the same as the iteration section
|
||||||
property.
|
property.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
<example>
|
<example>
|
||||||
<title>section property index</title>
|
<title>section property index</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@@ -2706,6 +2712,13 @@ The value of $name is Bob.</programlisting>
|
|||||||
counter function will be assigned to this template variable instead of
|
counter function will be assigned to this template variable instead of
|
||||||
being output to the template. (new in Smarty 1.5.0)
|
being output to the template. (new in Smarty 1.5.0)
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<para>
|
||||||
|
evaluated variables follow the same rules as templates, so for
|
||||||
|
instance PHP tags are escaped by default, or if you have
|
||||||
|
security enabled then embedding PHP is not allowed.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
<example>
|
<example>
|
||||||
<title>counter</title>
|
<title>counter</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@@ -2764,6 +2777,21 @@ OUTPUT:
|
|||||||
eval function will be assigned to this template variable instead of
|
eval function will be assigned to this template variable instead of
|
||||||
being output to the template.
|
being output to the template.
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
|
<para>
|
||||||
|
Evaluated variables are treated the same as templates. They follow
|
||||||
|
the same escapement and security features just as if they were
|
||||||
|
templates.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
|
Evaluated variables are compiled on every invocation, the compiled
|
||||||
|
versions are not saved! However if you have caching enabled, the
|
||||||
|
output will be cached with the rest of the template.
|
||||||
|
</para>
|
||||||
|
</note>
|
||||||
<example>
|
<example>
|
||||||
<title>eval</title>
|
<title>eval</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@@ -2848,16 +2876,22 @@ You must supply a <b>state</b>.
|
|||||||
fetch function will be assigned to this template variable instead of
|
fetch function will be assigned to this template variable instead of
|
||||||
being output to the template. (new in Smarty 1.5.0)
|
being output to the template. (new in Smarty 1.5.0)
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: This will not support http redirects, be sure to
|
This will not support http redirects, be sure to
|
||||||
include a trailing slash on your web page fetches where necessary.
|
include a trailing slash on your web page fetches where necessary.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: If template security is turned on and you are
|
If template security is turned on and you are
|
||||||
fetching a file from the local file system, this will only allow
|
fetching a file from the local file system, this will only allow
|
||||||
files from within one of the defined secure directories.
|
files from within one of the defined secure directories.
|
||||||
($secure_dir)
|
($secure_dir)
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
<example>
|
<example>
|
||||||
<title>fetch</title>
|
<title>fetch</title>
|
||||||
<programlisting>
|
<programlisting>
|
||||||
@@ -4142,14 +4176,17 @@ pass=foobar
|
|||||||
SMARTY_DEBUG in the URL if you enable this option with <link
|
SMARTY_DEBUG in the URL if you enable this option with <link
|
||||||
linkend="variable.debugging.ctrl">$debugging_ctrl</link>.
|
linkend="variable.debugging.ctrl">$debugging_ctrl</link>.
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: The debugging console does not work when you use the fetch()
|
The debugging console does not work when you use the fetch()
|
||||||
API, only when using display(). It is a set of javascript statements added
|
API, only when using display(). It is a set of javascript statements added
|
||||||
to the very bottom of the generated template. If you do not like javascript,
|
to the very bottom of the generated template. If you do not like javascript,
|
||||||
you can edit the debug.tpl template to format the output however you like.
|
you can edit the debug.tpl template to format the output however you like.
|
||||||
Debug data is not cached and debug.tpl info is not included in the output of
|
Debug data is not cached and debug.tpl info is not included in the output of
|
||||||
the debug console.
|
the debug console.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
<note>
|
<note>
|
||||||
<para>
|
<para>
|
||||||
The load times of each template and config file are in seconds, or
|
The load times of each template and config file are in seconds, or
|
||||||
|
@@ -69,8 +69,10 @@
|
|||||||
generated by the insert tag is not cached, but run dynamically on
|
generated by the insert tag is not cached, but run dynamically on
|
||||||
every invocation, even within cached content.
|
every invocation, even within cached content.
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: Any time you change a template, change values in
|
Any time you change a template, change values in
|
||||||
config files or change the content that gets displayed in a
|
config files or change the content that gets displayed in a
|
||||||
template, you can turn on compile_check to regenerate the caches
|
template, you can turn on compile_check to regenerate the caches
|
||||||
that are affected, or wait for the cache to expire to see the
|
that are affected, or wait for the cache to expire to see the
|
||||||
@@ -80,8 +82,11 @@
|
|||||||
linkend="api.clear.all.cache">clear_all_cache</link>, or turn on
|
linkend="api.clear.all.cache">clear_all_cache</link>, or turn on
|
||||||
$compile_check (or $force_compile).
|
$compile_check (or $force_compile).
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: As of Smarty 1.4.6, if you have caching enabled AND
|
As of Smarty 1.4.6, if you have caching enabled AND
|
||||||
you have compile_check enabled, the cached file will regenerate if
|
you have compile_check enabled, the cached file will regenerate if
|
||||||
an involved template or config file has been modified, regardless
|
an involved template or config file has been modified, regardless
|
||||||
of the cache expire time. This results in a slight performance hit
|
of the cache expire time. This results in a slight performance hit
|
||||||
@@ -91,6 +96,7 @@
|
|||||||
off. As of Smarty 1.4.7, enabling $force_compile will cause cache
|
off. As of Smarty 1.4.7, enabling $force_compile will cause cache
|
||||||
files to always be regenerated.
|
files to always be regenerated.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
</sect2>
|
</sect2>
|
||||||
</sect1>
|
</sect1>
|
||||||
</chapter>
|
</chapter>
|
||||||
@@ -120,8 +126,10 @@
|
|||||||
you will need to create a "cache" directory, also with permission to
|
you will need to create a "cache" directory, also with permission to
|
||||||
write files.
|
write files.
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: You can get around the need to allow the web server
|
You can get around the need to allow the web server
|
||||||
user write access to compile templates. Smarty needs to compile the
|
user write access to compile templates. Smarty needs to compile the
|
||||||
templates only once. This can be done from the command line, using the
|
templates only once. This can be done from the command line, using the
|
||||||
CGI version of PHP. example: "php -q index.php". Once the templates are
|
CGI version of PHP. example: "php -q index.php". Once the templates are
|
||||||
@@ -134,12 +142,16 @@
|
|||||||
the cache directory must always have write access for the web server
|
the cache directory must always have write access for the web server
|
||||||
user.
|
user.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: If you do not have access to the php.ini file, you can
|
If you do not have access to the php.ini file, you can
|
||||||
change non-server settings (such as your include_path) with the
|
change non-server settings (such as your include_path) with the
|
||||||
ini_set() command (available in PHP 4.0.4 or later.) example:
|
ini_set() command (available in PHP 4.0.4 or later.) example:
|
||||||
ini_set("include_path",".:/usr/local/lib/php");
|
ini_set("include_path",".:/usr/local/lib/php");
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
<para>
|
<para>
|
||||||
Copy the Smarty.class.php, Smarty.addons.php and Config_File.class.php
|
Copy the Smarty.class.php, Smarty.addons.php and Config_File.class.php
|
||||||
scripts to a directory that is in your PHP include_path. NOTE: PHP will
|
scripts to a directory that is in your PHP include_path. NOTE: PHP will
|
||||||
@@ -149,11 +161,14 @@
|
|||||||
directory yourself before hand, and change the file ownership
|
directory yourself before hand, and change the file ownership
|
||||||
accordingly. See below.
|
accordingly. See below.
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: If you don't want to use include_path to find the
|
If you don't want to use include_path to find the
|
||||||
Smarty files, you can set the SMARTY_DIR constant to the full path to
|
Smarty files, you can set the SMARTY_DIR constant to the full path to
|
||||||
your Smarty library files. Be sure the path ends with a slash!
|
your Smarty library files. Be sure the path ends with a slash!
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
<example>
|
<example>
|
||||||
<title>Example of installing Smarty</title>
|
<title>Example of installing Smarty</title>
|
||||||
<screen>
|
<screen>
|
||||||
|
@@ -15,10 +15,13 @@
|
|||||||
will look for the templates directory in the same directory as
|
will look for the templates directory in the same directory as
|
||||||
the executing php script.
|
the executing php script.
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: It is not mandatory to put this directory under
|
It is not mandatory to put this directory under
|
||||||
the web server document root.
|
the web server document root.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="variable.compile.dir">
|
<sect2 id="variable.compile.dir">
|
||||||
<title>$compile_dir</title>
|
<title>$compile_dir</title>
|
||||||
@@ -29,14 +32,20 @@
|
|||||||
the executing php script. This was added to Smarty version
|
the executing php script. This was added to Smarty version
|
||||||
1.2.1.
|
1.2.1.
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: This setting must be either a relative or
|
This setting must be either a relative or
|
||||||
absolute path. include_path is not used for writing files.
|
absolute path. include_path is not used for writing files.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: It is not mandatory to put this directory under
|
It is not mandatory to put this directory under
|
||||||
the web server document root.
|
the web server document root.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="variable.config.dir">
|
<sect2 id="variable.config.dir">
|
||||||
<title>$config_dir</title>
|
<title>$config_dir</title>
|
||||||
@@ -46,10 +55,13 @@
|
|||||||
for the configs directory in the same directory as the
|
for the configs directory in the same directory as the
|
||||||
executing php script.
|
executing php script.
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: It is not mandatory to put this directory under
|
It is not mandatory to put this directory under
|
||||||
the web server document root.
|
the web server document root.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="variable.plugins.dir">
|
<sect2 id="variable.plugins.dir">
|
||||||
<title>$plugins_dir</title>
|
<title>$plugins_dir</title>
|
||||||
@@ -109,12 +121,15 @@
|
|||||||
from that global array. $SCRIPT_NAME is globally assigned by
|
from that global array. $SCRIPT_NAME is globally assigned by
|
||||||
default from $HTTP_SERVER_VARS.
|
default from $HTTP_SERVER_VARS.
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: Server variables can be accessed through the
|
Server variables can be accessed through the
|
||||||
$smarty variable, such as {$smarty.server.SCRIPT_NAME}. See the
|
$smarty variable, such as {$smarty.server.SCRIPT_NAME}. See the
|
||||||
section on the
|
section on the
|
||||||
<link linkend="builtin.variable.smarty">$smarty</link> variable.
|
<link linkend="builtin.variable.smarty">$smarty</link> variable.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="variable.undefined">
|
<sect2 id="variable.undefined">
|
||||||
<title>$undefined</title>
|
<title>$undefined</title>
|
||||||
@@ -184,14 +199,20 @@
|
|||||||
function to control cache files, which will ignore this
|
function to control cache files, which will ignore this
|
||||||
setting. (added to Smarty 1.3.0)
|
setting. (added to Smarty 1.3.0)
|
||||||
</para>
|
</para>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: This setting must be either a relative or
|
This setting must be either a relative or
|
||||||
absolute path. include_path is not used for writing files.
|
absolute path. include_path is not used for writing files.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
|
<note>
|
||||||
|
<title>Technical Note</title>
|
||||||
<para>
|
<para>
|
||||||
TECHNICAL NOTE: It is not mandatory to put this directory under
|
It is not mandatory to put this directory under
|
||||||
the web server document root.
|
the web server document root.
|
||||||
</para>
|
</para>
|
||||||
|
</note>
|
||||||
</sect2>
|
</sect2>
|
||||||
<sect2 id="variable.cache.lifetime">
|
<sect2 id="variable.cache.lifetime">
|
||||||
<title>$cache_lifetime</title>
|
<title>$cache_lifetime</title>
|
||||||
|
Reference in New Issue
Block a user