svn: /phpdoc/doc-base/trunk/RFC/skeletons/ method.xml
| From: | Daniel Convissor | Date: | Wed, 05 May 2010 00:14:47 +0000 |
| Subject: | svn: /phpdoc/doc-base/trunk/RFC/skeletons/ method.xml | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-6579@lists.php.net to get a copy of this message | ||
danielc Wed, 05 May 2010 00:14:47 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=299000
Log:
Demonstrate how to document methods that have procedural option too.
Changed paths:
U phpdoc/doc-base/trunk/RFC/skeletons/method.xml
Modified: phpdoc/doc-base/trunk/RFC/skeletons/method.xml
===================================================================
--- phpdoc/doc-base/trunk/RFC/skeletons/method.xml 2010-05-05 00:04:16 UTC (rev 298999)
+++ phpdoc/doc-base/trunk/RFC/skeletons/method.xml 2010-05-05 00:14:47 UTC (rev 299000)
@@ -9,6 +9,13 @@
<refsect1 role="description">
&reftitle.description;
+<!-- IF OOP & PROCEDURAL
+
+If this method also has a procedural mapping, please use the instructions
+and code found inside the "IF OOP & PROCEDURAL" comments.
+
+ <para>&style.oop;</para>
+-->
<methodsynopsis>
<!-- Example: All methods have this -->
<type>thereturned
type</type><methodname>ClassName::methodName</methodname>
@@ -25,12 +32,15 @@
<fieldsynopsis><modifier>public</modifier><modifier>static</modifier><type>string</type><varname>name</varname></fieldsynopsis>
</classsynopsis>
-->
-<!-- Note:
- If the method/property has an alternate procedural mapping
- then the method/property synopsis MUST be listed BEFORE
- the function synopsis.
- See function.xml/refentry/refsect1[@role=descript]/methodsynopsis
- for how to describe the function synopsis.
+<!-- IF OOP & PROCEDURAL
+
+Procedural synopsis goes after OOP synopsis.
+
+ <para>&style.procedural;</para>
+ <methodsynopsis>
+ [Fill in function's parameter details just like in
+ function.xml/refentry/refsect1[@role=descript]/methodsynopsis]
+ </methodsynopsis>
-->
<para>
The function description goes here.
@@ -111,6 +121,9 @@
Any text that describes the purpose of the example, or what
goes on in the example should be here. (Inside the <example> tag, not out).
</para>
+<!-- IF OOP & PROCEDURAL
+ <para>&style.oop;</para>
+-->
<programlisting role="php">
<![CDATA[
<?php
@@ -123,7 +136,27 @@
?>
]]>
</programlisting>
- &example.outputs.similar;
+<!-- IF OOP & PROCEDURAL
+
+The first example should be a very basic demonstration of how to do the
+same task in both OOP and procedural PHP. Each of these demonstrations
+should be in their own program listings with the appropriate &style.*
+entity above it. The OOP way must be first.
+
+ <para>&style.procedural;</para>
+ <programlisting role="php">
+<![CDATA[
+<?php
+echo same_task_as_above();
+?>
+]]>
+ </programlisting>
+
+Also, use these plural output entities instead:
+ &examples.outputs;
+ &examples.outputs.similar;
+-->
+ &example.outputs;
<screen>
<![CDATA[
Use the PEAR Coding standards