/** * {@inheritdoc} */ public function register(Application $app) { $app['menu'] = $app->share(function ($app) { $builder = new MenuBuilder($app); return $builder; }); /** * @internal Backwards compatibility not guaranteed on this provider presently. */ $app['menu.admin'] = $app->share(function ($app) { $adminMenu = new AdminMenuBuilder(new MenuEntry('root', $app['config']->get('general/branding/path'))); $rootEntry = $adminMenu->build($app); return $rootEntry; }); }
/** * {@inheritdoc} */ public function register(Application $app) { $app['menu'] = $app->share(function ($app) { $builder = new MenuBuilder($app); return $builder; }); /** * @internal Backwards compatibility not guaranteed on this provider presently. */ $app['menu.admin'] = $app->share(function ($app) { // This service should not be invoked until request cycle since it depends // on url generation. Probably should be refactored somehow. $baseUrl = $app['url_generator']->generate('dashboard'); $adminMenu = new AdminMenuBuilder(new MenuEntry('root', $baseUrl)); $rootEntry = $adminMenu->build($app); return $rootEntry; }); }