Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

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: 1048 Views
  • Nicolaas
    Avatar
    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() {
          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

    1048 Views
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.