cvs: smarty /docs/en/designers config-files.xml /docs/en/designers/language-builtin-functions language-function-include.xml language-function-ldelim.xml language-function-literal.xml /docs/en/designers/language-custom-functions language-function-html-checkboxes.xml /docs/en/designers/language-modifiers language-modifier-date-format.xml /docs/en/designers/language-variables language-assigned-variables.xml /docs/en/programmers/api-variables variable-config-overwrite.xml
"Peter 'Mash' Morgan" <[email protected]>
| Newsgroups | gmane.comp.php.cvs.smarty |
|---|---|
| Message-ID | <cvspete_morgan1118000779@cvsserver> |
pete_morgan Sun Jun 5 15:46:19 2005 EDT
Modified files:
/smarty/docs/en/designers config-files.xml
/smarty/docs/en/designers/language-builtin-functions
language-function-include.xml
language-function-ldelim.xml
language-function-literal.xml
/smarty/docs/en/designers/language-custom-functions
language-function-html-checkboxes.xml
/smarty/docs/en/designers/language-modifiers
language-modifier-date-format.xml
/smarty/docs/en/designers/language-variables
language-assigned-variables.xml
/smarty/docs/en/programmers/api-variables
variable-config-overwrite.xml
Log:
Clean up WS, more linking and examples
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
pete_morgan-20050605154619.txt
(text/plain, 16.7 KB)
http://cvs.php.net/diff.php/smarty/docs/en/designers/config-files.xml?r1=1.5&r2=1.6&ty=u
Index: smarty/docs/en/designers/config-files.xml
diff -u smarty/docs/en/designers/config-files.xml:1.5 smarty/docs/en/designers/config-files.xml:1.6
--- smarty/docs/en/designers/config-files.xml:1.5 Mon May 23 11:43:00 2005
+++ smarty/docs/en/designers/config-files.xml Sun Jun 5 15:46:18 2005
@@ -1,13 +1,18 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
<chapter id="config.files">
<title>Config Files</title>
<para>
- Config files are handy for designers to manage global template
- variables from one file. One example is template colors. Normally if
- you wanted to change the color scheme of an application, you would have
- to go through each and every template file and change the colors. With
- a config file, the colors can be kept in one place, and only one file
+ Config files are handy for designers to manage global
+ template
+ variables from one file. One example is template colors.
+ Normally if
+ you wanted to change the color scheme of an application, you
+ would have
+ to go through each and every template file and change the
+ colors. With
+ a config file, the colors can be kept in one place, and only
+ one file
needs to be updated.
</para>
<example>
@@ -41,42 +46,75 @@
</example>
<para>
Values of
- <link linkend="language.config.variables">config file variables</link>
+ <link linkend="language.config.variables">config file
+ variables</link>
can be in quotes, but not necessary.
- You can use either single or double quotes. If you have a value that
- spans more than one line, enclose the entire value with triple quotes
- ("""). You can put comments into config files by any syntax that is not
- a valid config file syntax. We recommend using a <literal>#</literal>
+ You can use either single or double quotes. If you have a
+ value that
+ spans more than one line, enclose the entire value with
+ triple quotes
+ ("""). You can put comments into config files by any syntax
+ that is not
+ a valid config file syntax. We recommend using a <literal>
+ #</literal>
(hash) at the beginning of the line.
</para>
<para>
- This config file example has two sections. Section names are enclosed in
- brackets []. Section names can be arbitrary strings not containing
- <literal>[</literal> or <literal>]</literal> symbols. The four variables
- at the top are global variables, or variables not within a section.
- These variables are always loaded from the config file. If a particular
- section is loaded, then the global variables and the variables from that
- section are also loaded. If a variable exists both as a global and in a
- section, the section variable is used. If you name two variables the
- same within a section, the last one will be used. (see
- <link linkend="variable.config.overwrite">$config_overwrite</link>)
+ This config file example has two sections. Section names are
+ enclosed in
+ brackets []. Section names can be arbitrary strings not
+ containing
+ <literal>[</literal> or <literal>]</literal> symbols. The
+ four variables
+ at the top are global variables, or variables not within a
+ section.
+ These variables are always loaded from the config file. If a
+ particular
+ section is loaded, then the global variables and the
+ variables from that
+ section are also loaded. If a variable exists both as a
+ global and in a
+ section, the section variable is used. If you name two
+ variables the
+ same within a section, the last one will be used unless
+ <link linkend="variable.config.overwrite">
+ $config_overwrite</link>
+ is disabled.
</para>
<para>
- Config files are loaded into templates with the built-in function
+ Config files are loaded into templates with the built-in
+ function
<link
- linkend="language.function.config.load"><command>{config_load}</command></link>
- , and
+ linkend="language.function.config.load"><command>
+ {config_load}</command></link>
+ (see also
<link
- linkend="api.config.load"><command>config_load()</command></link>.
+ linkend="api.config.load"><command>config_load()</command></link> ).
</para>
<para>
- You can hide variables or entire sections by prepending the variable
- name or section name with a period. This is useful if your application
- reads the config files and gets sensitive data from them that the
- template engine does not need. If you have third parties doing template
- editing, you can be certain that they cannot read sensitive data from
+ You can hide variables or entire sections by prepending the
+ variable
+ name or section name with a period. This is useful if your
+ application
+ reads the config files and gets sensitive data from them
+ that the
+ template engine does not need. If you have third parties
+ doing template
+ editing, you can be certain that they cannot read sensitive
+ data from
the config file by loading it into the template.
</para>
+
+ <para>
+ See also
+ <link linkend="language.function.config.load">{config_load}</link>,
+ <link linkend="variable.config.overwrite">$config_overwrite</link>,
+ <link linkend="api.get.config.vars">get_config_vars()</link>,
+ <link linkend="api.clear.config">clear_config()</link>
+ and
+ <link linkend="api.config.load">config_load()</link>
+ </para>
+
</chapter>
<!-- Keep this comment at the end of the file
@@ -99,3 +137,4 @@
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
+
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-builtin-functions/language-function-include.xml?r1=1.7&r2=1.8&ty=u
Index: smarty/docs/en/designers/language-builtin-functions/language-function-include.xml
diff -u smarty/docs/en/designers/language-builtin-functions/language-function-include.xml:1.7 smarty/docs/en/designers/language-builtin-functions/language-function-include.xml:1.8
--- smarty/docs/en/designers/language-builtin-functions/language-function-include.xml:1.7 Fri May 27 12:25:01 2005
+++ smarty/docs/en/designers/language-builtin-functions/language-function-include.xml Sun Jun 5 15:46:19 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.7 $ -->
+<!-- $Revision: 1.8 $ -->
<sect1 id="language.function.include">
<title>{include}</title>
<informaltable frame="all">
@@ -109,8 +109,8 @@
<example>
<title>{include} and assign to variable</title>
- <para>This example assign the contents of nav.tpl to a variable
- and outputs at the top of page and the bottom.
+ <para>This example assigns the contents of nav.tpl to the $navbar variable,
+ which is then output at the top and bottom of the page.
</para>
<programlisting>
<![CDATA[
@@ -124,7 +124,7 @@
{include file="footer.tpl" logo="http://my.example.com/logo.gif"}
{$navbar}
</body>
- ]]>
+]]>
</programlisting>
</example>
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-builtin-functions/language-function-ldelim.xml?r1=1.8&r2=1.9&ty=u
Index: smarty/docs/en/designers/language-builtin-functions/language-function-ldelim.xml
diff -u smarty/docs/en/designers/language-builtin-functions/language-function-ldelim.xml:1.8 smarty/docs/en/designers/language-builtin-functions/language-function-ldelim.xml:1.9
--- smarty/docs/en/designers/language-builtin-functions/language-function-ldelim.xml:1.8 Fri May 27 12:25:01 2005
+++ smarty/docs/en/designers/language-builtin-functions/language-function-ldelim.xml Sun Jun 5 15:46:19 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.8 $ -->
+<!-- $Revision: 1.9 $ -->
<sect1 id="language.function.ldelim">
<title>{ldelim},{rdelim}</title>
<para>
@@ -29,6 +29,29 @@
{funcname} is how functions look in Smarty!
]]>
</screen>
+ <para>Another example with some javascript</para>
+ <programlisting>
+<![CDATA[
+<script language="JavaScript">
+function foo() {ldelim}
+ ... code ...
+{rdelim}
+</script>
+]]>
+ </programlisting>
+ <para>
+ will output
+ </para>
+ <screen>
+<![CDATA[
+<script language="JavaScript">
+function foo() {
+ .... code ...
+}
+</script>
+]]>
+ </screen>
+
</example>
<para>See also <link linkend="language.escaping">Escaping Smarty Parsing</link> </para>
</sect1>
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-builtin-functions/language-function-literal.xml?r1=1.8&r2=1.9&ty=u
Index: smarty/docs/en/designers/language-builtin-functions/language-function-literal.xml
diff -u smarty/docs/en/designers/language-builtin-functions/language-function-literal.xml:1.8 smarty/docs/en/designers/language-builtin-functions/language-function-literal.xml:1.9
--- smarty/docs/en/designers/language-builtin-functions/language-function-literal.xml:1.8 Fri May 27 12:25:01 2005
+++ smarty/docs/en/designers/language-builtin-functions/language-function-literal.xml Sun Jun 5 15:46:19 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.8 $ -->
+<!-- $Revision: 1.9 $ -->
<sect1 id="language.function.literal">
<title>{literal}</title>
<para>
@@ -19,19 +19,17 @@
<![CDATA[
{literal}
<script type="text/javascript">
-
- <!--
- function isblank(field) {
- if (field.value == '')
- { return false; }
- else
- {
- document.loginform.submit();
- return true;
- }
- }
- // -->
-
+<!--
+ function isblank(field) {
+ if (field.value == '')
+ { return false; }
+ else
+ {
+ document.loginform.submit();
+ return true;
+ }
+ }
+// -->
</script>
{/literal}
]]>
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-custom-functions/language-function-html-checkboxes.xml?r1=1.9&r2=1.10&ty=u
Index: smarty/docs/en/designers/language-custom-functions/language-function-html-checkboxes.xml
diff -u smarty/docs/en/designers/language-custom-functions/language-function-html-checkboxes.xml:1.9 smarty/docs/en/designers/language-custom-functions/language-function-html-checkboxes.xml:1.10
--- smarty/docs/en/designers/language-custom-functions/language-function-html-checkboxes.xml:1.9 Wed May 25 15:13:20 2005
+++ smarty/docs/en/designers/language-custom-functions/language-function-html-checkboxes.xml Sun Jun 5 15:46:19 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.9 $ -->
+<!-- $Revision: 1.10 $ -->
<sect1 id="language.function.html.checkboxes">
<title>{html_checkboxes}</title>
<informaltable frame="all">
@@ -95,7 +95,8 @@
'Joe Schmoe',
'Jack Smith',
'Jane Johnson',
- 'Charlie Brown'));
+ 'Charlie Brown')
+ );
$smarty->assign('customer_id', 1001);
?>
@@ -118,10 +119,11 @@
<?php
$smarty->assign('cust_checkboxes', array(
- 1000 => 'Joe Schmoe',
- 1001 => 'Jack Smith',
- 1002 => 'Jane Johnson',
- 1003 => 'Charlie Brown'));
+ 1000 => 'Joe Schmoe',
+ 1001 => 'Jack Smith',
+ 1002 => 'Jane Johnson',
+ 1003 => 'Charlie Brown')
+ );
$smarty->assign('customer_id', 1001);
?>
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml?r1=1.8&r2=1.9&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.8 smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml:1.9
--- smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml:1.8 Sun Jun 5 11:47:24 2005
+++ smarty/docs/en/designers/language-modifiers/language-modifier-date-format.xml Sun Jun 5 15:46:19 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.8 $ -->
+<!-- $Revision: 1.9 $ -->
<sect1 id="language.modifier.date.format">
<title>date_format</title>
<informaltable frame="all">
@@ -215,10 +215,11 @@
<note>
<title>Programmers note</title>
<para>
- date_format is essentially a wrapper to PHP's
+ <command>date_format</command> is essentially a wrapper to PHP's
<ulink url="&url.php-manual;strftime">strftime()</ulink> function.
You may have more or less conversion specifiers available depending
- on your system's strftime() function where PHP was compiled. Check your
+ on your system's <ulink url="&url.php-manual;strftime">strftime()</ulink>
+ function where PHP was compiled. Check your
system's manpage for a full list of valid specifiers.
</para>
</note>
http://cvs.php.net/diff.php/smarty/docs/en/designers/language-variables/language-assigned-variables.xml?r1=1.4&r2=1.5&ty=u
Index: smarty/docs/en/designers/language-variables/language-assigned-variables.xml
diff -u smarty/docs/en/designers/language-variables/language-assigned-variables.xml:1.4 smarty/docs/en/designers/language-variables/language-assigned-variables.xml:1.5
--- smarty/docs/en/designers/language-variables/language-assigned-variables.xml:1.4 Fri May 27 12:25:01 2005
+++ smarty/docs/en/designers/language-variables/language-assigned-variables.xml Sun Jun 5 15:46:19 2005
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<sect1 id="language.assigned.variables">
<title>Variables assigned from PHP</title>
<para>
@@ -69,7 +69,9 @@
array('fax' => '555-222-9876',
'email' => '[email protected]',
'phone' => array('home' => '555-444-3333',
- 'cell' => '555-111-1234')));
+ 'cell' => '555-111-1234')
+ )
+ );
$smarty->display('index.tpl');
?>
]]>
@@ -110,7 +112,6 @@
<programlisting role="php">
<![CDATA[
<?php
-
$smarty->assign('Contacts', array(
'555-222-9876',
'[email protected]',
@@ -118,7 +119,6 @@
'555-111-1234')
));
$smarty->display('index.tpl');
-
?>
]]>
</programlisting>
http://cvs.php.net/diff.php/smarty/docs/en/programmers/api-variables/variable-config-overwrite.xml?r1=1.1&r2=1.2&ty=u
Index: smarty/docs/en/programmers/api-variables/variable-config-overwrite.xml
diff -u smarty/docs/en/programmers/api-variables/variable-config-overwrite.xml:1.1 smarty/docs/en/programmers/api-variables/variable-config-overwrite.xml:1.2
--- smarty/docs/en/programmers/api-variables/variable-config-overwrite.xml:1.1 Tue Apr 13 07:39:14 2004
+++ smarty/docs/en/programmers/api-variables/variable-config-overwrite.xml Sun Jun 5 15:46:19 2005
@@ -1,13 +1,58 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.1 $ -->
- <sect1 id="variable.config.overwrite">
- <title>$config_overwrite</title>
- <para>
- If set to true, variables read in from config files will overwrite each
- other. Otherwise, the variables will be pushed onto an array. This is
- helpful if you want to store arrays of data in config files, just list
- each element multiple times. true by default.
+<!-- $Revision: 1.2 $ -->
+ <sect1 id="variable.config.overwrite">
+ <title>$config_overwrite</title>
+ <para>
+ If set to true (by default), variables read in from
+ <link linkend="config.files">config files</link> will overwrite each
+ other. Otherwise, the variables will be pushed onto an array. This is
+ helpful if you want to store arrays of data in config files, just list
+ each element multiple times.
+ </para>
+
+ <example>
+ <title>Array of config variables</title>
+ <para>
+ This examples uses
+ <link linkend="language.function.cycle">{cycle}</link> to
+ ouput a table with alternating red/gree/blue row colors
+ with $config_overwrite = false.
+ </para>
+ <para>The config file.</para>
+ <programlisting>
+<![CDATA[
+# row colors
+rowColors = #FF0000
+rowColors = #00FF00
+rowColors = #0000FF
+]]>
+ </programlisting>
+ <para>
+ The template with a
+ <link linkend="language.function.section">{section}</link> loop.
</para>
+ <programlisting>
+<![CDATA[
+<table>
+ {section name=r loop=$rows}
+ <tr bgcolor="{cycle values=#rowColors#}">
+ <td> ....etc.... </td>
+ </tr>
+ {/section}
+</table>
+]]>
+ </programlisting>
+ </example>
+ <para>
+ See also
+ <link linkend="language.function.config.load">{config_load}</link>,
+ <link linkend="config.files">config files</link>,
+ <link linkend="api.get.config.vars">get_config_vars()</link>,
+ <link linkend="api.clear.config">clear_config()</link>
+ and
+ <link linkend="api.config.load">config_load()</link>.
+ </para>
+
</sect1>
<!-- Keep this comment at the end of the file
Local variables: