Craft\InstantAnalyticsService::getGlobals PHP Method

getGlobals() public method

Get the global variables for our Twig context
public getGlobals ( $title ) : array
return array with 'instantAnalytics' => Analytics object
    public function getGlobals($title)
    {
        $result = array();
        if ($this->cachedAnalytics) {
            $analytics = $this->cachedAnalytics;
        } else {
            $analytics = $this->pageViewAnalytics("", $title);
            $this->cachedAnalytics = $analytics;
        }
        /* -- Return our global variables */
        $result['instantAnalytics'] = $analytics;
        return $result;
    }