static public function registerStack($stacks,$view)
    {
    	if ( ! is_array($stacks)) {
    		throw new InvalidConfigException('The $stacks argument should be provided as an array');
    	}
    	if ( ! $view instanceof yii\web\View) {
    		throw new InvalidConfigException('The $view argument should be provided as a yii\web\View');
    	}
    	foreach( $stacks as $name => $definition) {
    		$view->registerJs('var '.$name.' = '.Json::encode($definition).';');
    	}
    }