I put Event::trigger('toolbar_add_menu') into my toolbar module so any other modules can add their own menus to the toolbar. The trigger runs after all the Event::registers.
All my modules have a toolbar_menu method which returns an array of menu title, links etc., and also an Event::register('toolbar_add_menu', 'Mymodulename::toolbar_menu').
But this way it isnt works, becouse the module Event::register methods only run if the first URI segment matches with the module name.
How can I implement thet each module's menu load into the toolbar without loading all the modules?
Thank you!
In FuelPHP 2.0 modules and packages will be merged into one, and will have their own bootstrap.
It will still mean you will have to load all of them, otherwise the bootstrap will not be loaded.
In the meantime, I suggest you add a specific class to your modules, loop through all your modules, and use is_callable to check if your special class exists, and if it does, call it.