]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Widget automatically delegates unimplemented methods to attribute
authorEvan Prodromou <evan@status.net>
Mon, 21 Mar 2011 15:09:16 +0000 (11:09 -0400)
committerEvan Prodromou <evan@status.net>
Mon, 21 Mar 2011 15:09:16 +0000 (11:09 -0400)
lib/widget.php

index 0258c8649e8c89e9776b6cf327829aa1025653a5..f9b71525598365a939933a57c3231228401a02dc 100644 (file)
@@ -79,4 +79,17 @@ class Widget
     function show()
     {
     }
+
+    /**
+     * Delegate output methods to the outputter attribute.
+     *
+     * @param string $name      Name of the method
+     * @param array  $arguments Arguments called
+     *
+     * @return mixed Return value of the method.
+     */
+    function __call($name, $arguments)
+    {
+        return call_user_func_array(array($this->out, $name), $arguments);
+    }
 }