cvs: peardoc /en/package/html/html-template-sigma intro-syntax.xml /en/package/html/html-template-sigma/html-template-sigma setoption.xml

From: Date: Tue, 22 Jul 2008 20:12:50 +0000
Subject: cvs: peardoc /en/package/html/html-template-sigma intro-syntax.xml /en/package/html/html-template-sigma/html-template-sigma setoption.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-11026@lists.php.net to get a copy of this message
avb Tue Jul 22 20:12:50 2008 UTC Modified files: /peardoc/en/package/html/html-template-sigma intro-syntax.xml /peardoc/en/package/html/html-template-sigma/html-template-sigma setoption.xml Log: Document changes for release 1.2.0, Clarify workings of <!-- INCLUDE --> statement (Bug #13379) http://cvs.php.net/viewvc.cgi/peardoc/en/package/html/html-template-sigma/intro-syntax.xml?r1=1.4&r2=1.5&diff_format=u Index: peardoc/en/package/html/html-template-sigma/intro-syntax.xml diff -u peardoc/en/package/html/html-template-sigma/intro-syntax.xml:1.4 peardoc/en/package/html/html-template-sigma/intro-syntax.xml:1.5 --- peardoc/en/package/html/html-template-sigma/intro-syntax.xml:1.4 Wed Jun 27 17:17:49 2007 +++ peardoc/en/package/html/html-template-sigma/intro-syntax.xml Tue Jul 22 20:12:50 2008 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="package.html.html-template-sigma.intro-syntax"> <refnamediv> <refname>Introduction - template syntax</refname> @@ -61,10 +61,22 @@ Some things to note: <itemizedlist> <listitem> + <para> + <literal>&lt;!-- INCLUDE --&gt;</literal> statements are only processed when loading the + template files from disk. If you use + <link linkend="package.html.html-template-sigma.html-template-sigma.settemplate"><function>setTemplate</function></link> + method to set the template or + <link linkend="package.html.html-template-sigma.html-template-sigma.addblock"><function>addBlock</function></link> and + <link linkend="package.html.html-template-sigma.html-template-sigma.replaceblock"><function>replaceBlock</function></link> + to work with its blocks, then <literal>&lt;!-- INCLUDE --&gt;</literal> statements in + these templates will not be replaced! + </para> + </listitem> + <listitem> <para>Although this functionality is implemented using <link linkend="package.html.html-template-sigma.html-template-sigma.addblockfile"><function>addBlockfile</function></link>, unlike <function>addBlockfile</function> no new blocks are created in the template.</para> </listitem> <listitem> - <para><literal>&lt;!-- INCLUDE --&gt;</literal> calls are processed before any variable substitution can take place. So <literal>&lt;!-- INCLUDE {placeholder} --&gt;</literal> will not work unless you actually have a file named <filename>{placeholder}</filename> and want to load it.</para> + <para><literal>&lt;!-- INCLUDE --&gt;</literal> statements are processed before any variable substitution can take place. So <literal>&lt;!-- INCLUDE {placeholder} --&gt;</literal> will not work unless you actually have a file named <filename>{placeholder}</filename> and want to load it.</para> </listitem> </itemizedlist> </para> @@ -97,7 +109,7 @@ <note> <para> The information in this section applies to <classname>HTML_Template_Sigma</classname> - version 1.1.2 and later, please upgrade if you have problems with template + version 1.1.2 and later, please upgrade if you have problems with template function arguments in previous versions. </para> </note> @@ -109,9 +121,9 @@ func_uppercase(Some unquoted text) ]]> </programlisting> - But consider the following: function arguments are contained within + But consider the following: function arguments are contained within parentheses and separated by commas. Therefore if closing parenthesis - <literal>&apos;)&apos;</literal> or comma <literal>&apos;,&apos;</literal> + <literal>&apos;)&apos;</literal> or comma <literal>&apos;,&apos;</literal> appears in function argument, it should be quoted. </para> <para> @@ -129,8 +141,8 @@ argument starts with a quote, it should be quoted. </para> <para> - Finally, the argument should be quoted if it is an empty string or if its - leading or trailing whitespace is significant (leading and trailing whitespace + Finally, the argument should be quoted if it is an empty string or if its + leading or trailing whitespace is significant (leading and trailing whitespace will be removed from unquoted arguments). </para> <para> @@ -168,7 +180,7 @@ </example> </refsect2> </refsect1> - + <refsect1 id="package.html.html-template-sigma.intro-syntax.callback-shorthand"> <title>Shorthand for template functions</title> <para> @@ -183,11 +195,38 @@ There are 3 automatically registered template functions <itemizedlist> <listitem><simpara>'h' for <ulink url="&url.php.lookup;htmlspecialchars"><function>htmlspecialchars</function></ulink></simpara></listitem> + <listitem><simpara> + 'e' for <ulink url="&url.php.lookup;htmlentities"><function>htmlentities</function></ulink> + (available since release 1.2.0) + </simpara></listitem> <listitem><simpara>'u' for <ulink url="&url.php.lookup;urlencode"><function>urlencode</function></ulink></simpara></listitem> + <listitem><simpara> + 'r' for <ulink url="&url.php.lookup;rawurlencode"><function>rawurlencode</function></ulink> + (available since release 1.2.0) + </simpara></listitem> <listitem><simpara>'j' for a method of <classname>Sigma</classname> that escapes the string for usage in Javascript string constants.</simpara></listitem> </itemizedlist> </para> <para>Thus, if you add <literal>{var:h}</literal> placeholder to the template, var will be have unsafe characters replaced by corresponding HTML entitites.</para> + <para> + Since release 1.2.0 it is possible to provide the charset parameter for 'h' and 'e' + callbacks via <link linkend="package.html.html-template-sigma.html-template-sigma.setoption"><function>setOption</function></link>. + </para> + </refsect1> + + <refsect1 id="package.html.html-template-sigma.intro-syntax.comment"> + <title>Template comments</title> + <para> + Since release 1.2.0 it is possible to add comments to the template file: + <programlisting> + <![CDATA[ +<!-- COMMENT --> +Some text here +<!-- /COMMENT --> + ]]> + </programlisting> + These comments will be removed from the output, unlike standard HTML comments. + </para> </refsect1> <refsect1 id="package.html.html-template-sigma.intro-syntax.example"> @@ -220,6 +259,9 @@ <title>The <filename>table_header.html</filename> template file</title> <programlisting> <![CDATA[ +<!-- COMMENT --> +This text will not appear in output. +<!-- /COMMENT --> <tr> <th>First name</th> <th>Last name</th> http://cvs.php.net/viewvc.cgi/peardoc/en/package/html/html-template-sigma/html-template-sigma/setoption.xml?r1=1.4&r2=1.5&diff_format=u Index: peardoc/en/package/html/html-template-sigma/html-template-sigma/setoption.xml diff -u peardoc/en/package/html/html-template-sigma/html-template-sigma/setoption.xml:1.4 peardoc/en/package/html/html-template-sigma/html-template-sigma/setoption.xml:1.5 --- peardoc/en/package/html/html-template-sigma/html-template-sigma/setoption.xml:1.4 Wed Apr 14 13:24:07 2004 +++ peardoc/en/package/html/html-template-sigma/html-template-sigma/setoption.xml Tue Jul 22 20:12:50 2008 @@ -1,4 +1,4 @@ -<!-- $Revision: 1.4 $ --> +<!-- $Revision: 1.5 $ --> <refentry id="package.html.html-template-sigma.html-template-sigma.setoption"> <refnamediv> <refname>setOption()</refname> @@ -39,6 +39,16 @@ </para> </listitem> </varlistentry> + <varlistentry> + <term>charset</term> + <listitem> + <para> + Character set to use by builtin 'h' and 'e' callbacks. + Default is <literal>'iso-8859-1'</literal>. + Available since release 1.2.0 + </para> + </listitem> + </varlistentry> </variablelist> </para> </refsect1>

« previous php.pear.doc (#11026) next »