I'm having issues getting hold of values stored in my SiteConfig from within my widget class. I searched around and found people suggesting I should be able to access the config through SiteConfig::current_site_config() but when I try and implement this, I get an error:
Parse error: syntax error, unexpected '(', expecting ',' or ';' in /...../widgets_facebookFeed/FacebookFeedWidget.php on line 3
<?php
class FacebookFeedWidget extends Widget{
static $thisConfig = SiteConfig::current_site_config();
static $title = "";
static $cmsTitle = "Facebook Feed Widget";
static $description = "This widget shows the Facebook feed";
static $db = array(
"FacebookURL" => "Text"
);
static $defaults = array(
"FacebookURL" => $thisConfig->FacebookURL
);
function getCMSFields(){
return new FieldList(
new TextField("FacebookURL", "Facebook URL")
);
}
function getFacebookURL(){
$output = new ArrayList();
$output->push(
new ArrayData(
array(
"FacebookURL" => $this->URL
)
)
);
return $output;
}
}
What am I doing wrong here?