Global Configuration : config.yml

This file manage the global paramaters of an entity :

  • config.yml in root path manage framework configuration ./config/config.yml
  • config.yml in app bundle manage Application configuration ./app/config/config.yml
  • config.yml in bundles manage bundle configuration ./src/bundles/demo-bundle/Ressources/config/config.yml

How to use this parameters :

There are different ways to access these configuration variables
  • In controller By Kernel Service Container this.getParameters("bundles.App")
    
    module.exports = class defaultController extends nodefony.controller {
    
    	constructor(container, context){
    		super(container, context);
    	};
    
    	indexAction (version){
    		// GET config bundle App
    		 let bundleAppSettings = this.getParameters("bundles.App") ;
    		// GET config bundle http
    		 let bundleHttpSettings = this.getParameters("bundles.http") ;
    
    		return this.renderJson(bundleAppSettings);
    	};
    };
    				
  • In Kernel you can find this.settings with framework configuration
    
    indexAction (version){
    	// GET kernel service and get config
    	let kernelGlobalSettings = this.kernel.settings ;
    
    	return this.renderJson(kernelGlobalSettings);
    };
    				
  • In Bundle you can find this.settings with bundle configuration
    indexAction (version){
    	// GET kernel service , get demo bundle  config
    	let demo-bundleGlobalSettings = this.kernel.getBundle("demo").settings ;
    
    	return this.renderJson(demo-bundleGlobalSettings);
    };
    
    				
  • Everywhere you can find config variables by Kernel Service Container
    
    module.exports =  class myService extends nodefony.Service {
    
    	constructor (kernel)
    		super("myService", kernel.container, kernel.notificationsCenter );
    	};
    
    	myFunction (){
    		let kernelSettings = this.kernel.settings ;
    		let appSettings = this.getParameters("bundles.App") ;
    	};
    };
    
    					

Routing Configuration : routing.js

Security Configuration : security.yml

Service Configuration : service.js

Webpack Configurations : webpack/...