From 6b51ccebf38c02326891269ffdfa8d93437ff4f9 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 7 Sep 2009 06:26:49 +0000 Subject: [PATCH] ENHANCEMENT Allowing Widget->Content() to render with any templates found in ancestry instead of requiring a template for the specific subclass git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@85823 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- widgets/Widget.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/widgets/Widget.php b/widgets/Widget.php index f51c77720..7eef7a543 100644 --- a/widgets/Widget.php +++ b/widgets/Widget.php @@ -55,7 +55,7 @@ class Widget extends DataObject { * @return string HTML */ function Content() { - return $this->renderWith($this->class); + return $this->renderWith(array_reverse(ClassInfo::ancestry($this->class))); } function Title() { @@ -176,7 +176,7 @@ class Widget_Controller extends Controller { * @return string HTML */ function Content() { - return $this->renderWith($this->widget->class); + return $this->renderWith(array_reverse(ClassInfo::ancestry($this->widget->class))); } /**