Pass variable from class public function object

Hello all,

I am having trouble with understanding using variables between classes.

pass class variables to a variables?

pass class variables to an included file?

How to pass or get the variable $analytics for this included file or to use it directly by placing the script in the index file?
In the ganalytics.php file is the script routine.


if ($this->tplparams['scripts'] != "deactivated") {


class tploneweb {
    private function getParams() {
        $eModule = eFactory::getModule();
        $xmlpath = ELXIS_PATH.'/templates/oneweb/oneweb.xml';
        $tplparams = $this->getDBParams();
        $params = new  elxisParameters($tplparams, $xmlpath, 'template');

            $this->tplparams['scripts']         = $params->get('scripts');
    public function gAnalytics() {
        $eDoc = eFactory::getDocument();
        $elxis = eFactory::getElxis();

        if ($this->tplparams['analytics'] != "UA-XXXXX-X") {
            $analytics = $this->tplparams['analytics'];
            echo $analytics;