I'm new to web development with Symphony2 (although definitely not new to web development), and I'm going to start a medium-sized project that will be cut into packages, since each installation of the application may have a different setting of available functions.
I would like to dynamically generate my navigation from available packages, for example. if the package "foo" is active, a menu entry should appear indicating the path to the action of the main controller foo.
Usually, I take it upon myself to create a singleton somewhere that I would then fill during the load () function of the package, and during rendering I would output singleton.
But symfony2 offers a lot of flexibility in this part, so I am currently evaluating if there might be a better way.
Can the services be here? Or events? Or something with dependency injection, so the instance of the NavigationConfigurationElement appears in the bundles at build time?
Any messages or thoughts on this, or maybe some links to examples on how to do this, are welcome.
Regards, Jens
source
share