1
0
mirror of https://github.com/silverstripe/silverstripe-framework synced 2024-10-22 14:05:37 +02:00

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
This commit is contained in:
Ingo Schommer 2009-09-07 06:26:49 +00:00
parent 0cc95bec5f
commit 6b51ccebf3

View File

@ -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)));
}
/**