Assigning variables from controller into view


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()




and nothing…

What’s wrong?

(Matthieu Aubry) #2

try {$params.pwc_sites]}


Thanks matt. It’s works.