21/02/2013 1:10pm

PHP | Problem -


static $db = array(

"WidgetTitle" => "Text",
"SubTitle" => "Text"
);

function getCMSFields(){
return new FieldList(
new TextField("WidgetTitle", "Titel boven de tekst"),
new TextField("SubTitle", "Subtitel bij widget")
);
}

function getMembers($num = 3){
$group = DataObject::get_one("Group", "Title = 'Onze Saars'");
$members = $group->Members()->limit($num)->Sort(RAND());
return $members;
}

function GetTextWidget(){
$output = new DataObjectSet();
$output->push(
new ArrayData(
array(
"WidgetTitle" => $this->Title,
"SubTitle" => $this->SubTitle
)
)
);
$output->push(
new ArrayData (
pullMembers()
)
);
return $output;
}
function WidgetHolder() {
return $this->renderWith("SaarsWidget");
}


Post Comment