Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

why is this not working


Go to End


1321 Views

Avatar
Nicolaas

Forum Moderator, 224 Posts

2 April 2008 at 12:34pm

Hi I have the following PHP file:

class GoogleAnalytics extends ContentController {

static $googleAnalyticsCode;
function init() {
parent::init();
}
Public function analyticsCode() {
echo "xyz";
return self::$googleAnalyticsCode;
}
}

In my /Includes/Analytics.ss file I have
...
$analyticsCode
...

the Analytics template is included, but I do not get an error message (because of the echo and there is no analyticsCode. I was wondering if anyone can tell what I am doing wrong - please?

Nicolaas