Jump to:

17452 Posts in 4473 Topics by 1971 members


SilverStripe Forums » Archive » why is this not working

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

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

Page: 1
Go to End
Author Topic: 1069 Views
  • Nicolaas
    Forum Moderator
    213 Posts

    why is this not working Link to this post

    Hi I have the following PHP file:

    class GoogleAnalytics extends ContentController {

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

    In my /Includes/Analytics.ss file I have

    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?


Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.