cvs: peardoc /en/package/html/html-template-flexy/tag variable.xml
| From: | Christian Weiske | Date: | Mon, 17 Nov 2008 20:32:04 +0000 |
| Subject: | cvs: peardoc /en/package/html/html-template-flexy/tag variable.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-11280@lists.php.net to get a copy of this message | ||
cweiske Mon Nov 17 20:32:04 2008 UTC
Modified files:
/peardoc/en/package/html/html-template-flexy/tag variable.xml
Log:
Fix doc Bug #12685: User note that is a documentation problem
Tell about {variable.property} and {variable.method()}
http://cvs.php.net/viewvc.cgi/peardoc/en/package/html/html-template-flexy/tag/variable.xml?r1=1.9&r2=1.10&diff_format=u
Index: peardoc/en/package/html/html-template-flexy/tag/variable.xml
diff -u peardoc/en/package/html/html-template-flexy/tag/variable.xml:1.9
peardoc/en/package/html/html-template-flexy/tag/variable.xml:1.10
--- peardoc/en/package/html/html-template-flexy/tag/variable.xml:1.9 Thu Oct 9 15:16:37 2008
+++ peardoc/en/package/html/html-template-flexy/tag/variable.xml Mon Nov 17 20:32:04 2008
@@ -6,7 +6,7 @@
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
-
+
<funcprototype>
<funcdef>
<function>Usage</function></funcdef>
@@ -30,72 +30,65 @@
</para>
<para>
by default variables are assumed to have calling scope, and are prefixed with $t->,
however if they
- are inside a loop (foreach), then the variables created by the loop are added to the scope
and the prefix
+ are inside a loop (foreach), then the variables created by the loop are added to the scope
and the prefix
is not added.
</para>
- </refsection>
-
-
-
-
+
+ <para>
+ Accessing object variables can be done using a dot as separator:
+ <literal>{object.property}</literal>,
+ calling methods is identical: <literal>{object.method()}</literal>.
+ </para>
+ </refsection>
+
+
+
<refsection xml:id="package.html.html-template-flexy.tag.variable.example">
&title.example;
- <example><info><title>setting an object variable</title></info>
-
- <programlisting role="html">
- <![CDATA[
-
+ <example>
+ <info><title>setting an object variable</title></info>
+ <programlisting role="html"><![CDATA[
$this->a = "hello >>";
$template->outputObject($this);
-
-
-]]>
- </programlisting>
+]]></programlisting>
</example>
-
- <example><info><title>Outputting the variable</title></info>
-
- <programlisting role="html">
- <![CDATA[
-
+
+ <example>
+ <info><title>Outputting the variable</title></info>
+ <programlisting role="html"><![CDATA[
{a}
{a:h}
{a:u}
-
-]]>
- </programlisting>
+]]></programlisting>
</example>
-
- <example><info><title>Compiled template</title></info>
-
+
+
+ <example>
+ <info><title>Compiled template</title></info>
+
<programlisting role="html">
- <![CDATA[
-
+ <![CDATA[
<?php echo htmlspecialchars($t->a); ?>
-<?php echo $t->a; ?>
+<?php echo $t->a; ?>
<?php echo urlencode($t->a); ?>
-
-
-
-]]>
+]]>
</programlisting>
</example>
-
- <example><info><title>Simple ouput example</title></info>
-
+
+ <example>
+ <info><title>Simple ouput example</title></info>
+
<programlisting role="html">
- <![CDATA[
-
+ <![CDATA[
hello >>
hello >>
-hello+%3E%3
-
-]]>
+hello+%3E%3
+]]>
</programlisting>
</example>
- </refsection>
-
-
-
-
+ </refsection>
+
+
+
+
</refentry>