kunstmaan/bundles-cms
Kunstmaan CMS is a full-featured, multilingual CMS built on the Symfony full-stack framework. It offers page and form assembly, versioning, workflow, translation tools, and media management, plus integrations with community bundles.
Configuring the action or sub action menu of pages is simply a matter of connecting an event listener to the KunstmaanNodeBundle/Helper/Event/Events::CONFIGURE_ACTION_MENU or the KunstmaanNodeBundle/Helper/Event/Events::CONFIGURE_SUB_ACTION_MENU event:
# src/Acme/MainBundle/Resources/config/services.yml
services:
acme_hello.configure_sub_actions_menu_listener:
class: Acme\MainBundle\EventListener\ConfigureActionsMenuListener
arguments: ["[@doctrine](https://github.com/doctrine).orm.entity_manager", "[@router](https://github.com/router)"]
tags:
- { name: 'kernel.event_listener', event: 'kunstmaan_node.configureSubActionMenu', method: 'onSubActionMenuConfigure' }
and in the listener function you can now modify the menu:
/**
* [@param](https://github.com/param) \Kunstmaan\NodeBundle\Event\ConfigureActionMenuEvent $event
*/
public function onSubActionMenuConfigure(ConfigureActionMenuEvent $event)
{
$menu = $event->getMenu();
$activeNodeVersion = $event->getActiveNodeVersion();
if (!is_null($activeNodeVersion)) {
$menu->addChild('subaction.hello_world', array('uri' => $this->router->generate('AcmeMainBundle_Hello_World')));
}
}
How can I help you explore Laravel packages today?