From 65770a03f65fc2fea05c3d3c4af4aa06deffbbf4 Mon Sep 17 00:00:00 2001 From: Neuman Vong Date: Fri, 29 Oct 2010 14:05:55 -0700 Subject: [PATCH] Use is_callable instead of method_exists To use objects implementing __call(). Closes #18. --- Mustache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mustache.php b/Mustache.php index 2b7551c..da79733 100644 --- a/Mustache.php +++ b/Mustache.php @@ -603,7 +603,7 @@ class Mustache { protected function _findVariableInContext($tag_name, $context) { foreach ($context as $view) { if (is_object($view)) { - if (method_exists($view, $tag_name)) { + if (is_callable(array($view, $tag_name))) { return $view->$tag_name(); } else if (isset($view->$tag_name)) { return $view->$tag_name;