summaryrefslogtreecommitdiff
path: root/documentation/magic-methods.html
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/magic-methods.html')
-rw-r--r--documentation/magic-methods.html31
1 files changed, 25 insertions, 6 deletions
diff --git a/documentation/magic-methods.html b/documentation/magic-methods.html
index a3fa4de..0f2067f 100644
--- a/documentation/magic-methods.html
+++ b/documentation/magic-methods.html
@@ -224,7 +224,18 @@ public:
*/
Php::Value __call(const char *name, Php::Parameters &params)
{
- return std::string("method: ")+name;
+ // the return value
+ std::string retval = name;
+
+ // loop through the parameters
+ for (auto &param : params)
+ {
+ // append parameter string value to return value
+ retval += " " + param.stringValue();
+ }
+
+ // done
+ return retval;
}
};
@@ -257,16 +268,24 @@ extern "C" {
</code></pre>
</p>
<p>
- The following PHP script calls some method on this class.
-</p>
-<p>
<pre code="language-php"><code>
&lt;?php
// initialize an object
$object = new MyClass();
echo($object->something()."\n");
-echo($object->myMethod()."\n");
-echo($object->whatever()."\n");
+echo($object->myMethod(1,2,3,4)."\n");
+echo($object->whatever("a","b")."\n");
?&gt;
</code></pre>
</p>
+<p>
+ The above PHP script calls some method on this class. And will generate
+ the following output:
+</p>
+<p>
+<pre>
+something
+myMethod 1 2 3 4
+whatever a b
+</pre>
+</p>