samsonos / cms_ui
SamsonCMS generic user interface
dev-master
2014-12-16 11:47 UTC
Requires
- samsonos/php_core: 1.*
Requires (Dev)
- phpunit/phpunit: 4.*
This package is not auto-updated.
Last update: 2024-12-21 17:12:13 UTC
README
#SamsonCMS User interface
This module gives abstraction level for working with all UI components in SamsonCMS environment.
Adding item to main menu
When UI creates workspace main menu container an cms_ui.mainmenu_created
event is fired.
Example of how to add custom menu item:
- Subscribe to event
- Add menu item, as you have an access to menu container
// Subscribe to UI main menu creation event Event::subscribe('cms_ui.mainmenu_created', array($this, 'mainMenuItem')); class MyApplication { public function mainMenuItem(\samsonos\cms\ui\Menu $menu, \samsonos\cms\ui\UIApplication $ui) { $menu->add(new MenuItem()); } }