From 0a71622aa731c62c89ba84ef86d21fd168521ee1 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 21 Mar 2011 11:09:16 -0400 Subject: [PATCH] Widget automatically delegates unimplemented methods to attribute --- lib/widget.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/widget.php b/lib/widget.php index 0258c8649e..f9b7152559 100644 --- a/lib/widget.php +++ b/lib/widget.php @@ -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); + } } -- 2.39.5