From 434e920ba3784a5c4a8f4ade4774f050720c09ae Mon Sep 17 00:00:00 2001 From: Basil Date: Sat, 13 Oct 2018 09:40:14 +0200 Subject: [PATCH] Update app-menu.md --- docs/guide/app-menu.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/guide/app-menu.md b/docs/guide/app-menu.md index 31867e9da..00691c7e1 100644 --- a/docs/guide/app-menu.md +++ b/docs/guide/app-menu.md @@ -5,6 +5,20 @@ The {{\luya\cms\Menu}} component allows you to build website navigations. The me You can access the {{\luya\cms\Menu}} component trough `Yii::$app->menu`. This component help you to create menus, find childs, get items of containers, get property data and much more. The menu component is automatically registered when adding the CMS module to your config. +The menu component is registered automatically in your config, if you need to configure or modify settings the registration of the componeont looks like this: + +```php +return [ + // ... + 'components' => [ + 'menu' => [ + 'class' => 'luya\cms\Menu', + // component properties + ], + ] +] +``` + When you request a menu item, you will always get a {{\luya\cms\menu\Item}} object which provides a lot of getter methods. The menu component automatically loads the {{\luya\cms\Menu::getCurrent()}} active menu item based on your current language which will be evaluated by the {{\luya\web\Composition}} component.