Quantcast
Channel: Piwik Forums - Support & Bugs
Viewing all articles
Browse latest Browse all 4243

howto include *.js files in own plugins (1 reply)

$
0
0
Hello,

I'm developing a own Piwik plugin and I cant include a JS file. So far I made the hook in the myPlugin.php see as below:

function getListHooksRegistered()
{
	return array( 
		'AdminMenu.add' => 'addMenu',
		'AssetManager.getJsFiles' => 'getJsFiles',
	);
}

function getJsFiles($notification)
{
	$jsFiles = &$notification->getNotificationObject();
	$jsFiles[] = "plugins/myPlugin/templates/MyPlugin.js";		
}

do I have to do something else, because so far, this is not working. My *.js file is on the server and has just a console.log in it.

thanks in advance, Peter

Viewing all articles
Browse latest Browse all 4243

Trending Articles