Assigning variables from controller into view


#1

Hi! Now I’m develop a plugin for piwik. And I’m stack at one point…

In API.php a create method looks like this


public function getParams($json=false) {
	$params = parse_ini_file('config/local.config.counter.ini');

	if ($json === true) {
		return json_encode($params);
	} else {
		return $params;
	}
}

And in controller


public function index() {
	...
	$view->params = Piwik_Counter_API::getInstance()->getParams();
	echo $view->render();
}

And in .tpl file I try to access a variable returned in getParams()


{'$params[pwc_sites]'}

or


{'$this->params[pwc_sites]'}

and nothing…

What’s wrong?


(Matthieu Aubry) #2

try {$params.pwc_sites]}


#3

Thanks matt. It’s works.