You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A menu, or navigation container, is a class implementing the \RecursiveIterator interface. It has a hierarchical structure, with nodes called pages(see the `Page` class) that may have children. It is basically a tree
43
+
A menu, or navigation container, is a class implementing the `RecursiveIterator` interface.
44
+
It has a hierarchical structure, with nodes called pages (see the `Page` class) that may have children. It is basically a tree
44
45
45
-
A Page extends the NavigationContainer class. The NavigationContainer is the top most node which represents the entire menu. The children of this node are Page instances that defines each navigation item.
46
+
A Page extends the NavigationContainer class. The NavigationContainer is the top most node which represents the entire menu.
47
+
The children of this node are Page instances that define each navigation item.
46
48
47
-
A page has a reference to its parent, and can have options and attributes. There are no limitation on what is accepted as options or attributes.
49
+
A page has a reference to its parent and can have options and attributes. There is no limitation on what is accepted as options or attributes.
48
50
49
-
Options can be any piece of information that describes a page. Some predefined options exists, in order for the navigation module to work seamlessly with other dot modules.
51
+
Options can be any piece of information that describes a page.
52
+
Some predefined options exist in order for the navigation module to work seamlessly with other dot modules.
50
53
51
-
Attributes are key value pairs that defines the menu item. They are usually inserted as html attributes when parsing the menu, but of course, this is implementation specific.
54
+
Attributes are key value pairs that define the menu item.
55
+
They are usually inserted as HTML attributes when parsing the menu, but of course, this is implementation-specific.
52
56
53
-
A `NavigationService` class, is the service that handles all defined menu container. It can fetch the container from its provider, check if a page is active or not and get the page's generated URI.
57
+
A `NavigationService` class, is the service that handles all defined menu containers.
58
+
It can fetch the container from its provider, check if a page is active or not, and get the page's generated URI.
54
59
55
60
## Container providers
56
61
@@ -62,20 +67,21 @@ We offer just one provider for now, `ArrayProvider`, that is able to fetch and c
62
67
63
68
## NavigationRenderer
64
69
65
-
Used to render the navigation container in a displayable format. It can render a simple HTML ul list or use a partial template, to render the menu in a template engine.
70
+
Used to render the navigation container in a displayable format.
71
+
It can render a simple HTML unordered list or use a partial template to render the menu in a template engine.
66
72
67
73
The partial method is usually the more flexible one, custom rules can be defined and checked in the template.
68
74
69
-
If you are using Twig, there is already a Twig extension provided in package dot-twigrenderer, that you can use to easily parse the menus inside your templates
75
+
If you are using Twig, there is already a Twig extension provided in package dot-twigrenderer that you can use to easily parse the menus inside your templates
70
76
71
-
When using the partial method, the template will receive as parameters the container, the navigation service and any extra parameters set by the developer.
77
+
When using the partial method, the template will receive as parameters the container, the navigation service, and any extra parameters set by the developer.
72
78
73
-
Navigation containers are referred, when parsed, by their name, as defined in the configuration file.
79
+
Navigation containers are referred to, when parsed, by their name, as defined in the configuration file.
74
80
75
81
## Required page options and attributes
76
82
77
83
The following are options that each page should define in the configuration
78
84
79
85
*`label` - the text of the menu item
80
86
*`route` or `uri` - defines the route or link the menu item will have
81
-
*`permission` - can be used optionally, if authorization service is present, in order to omit menu items that are not authorized to visit.
87
+
*`permission` - can be used optionally if authorization service is present, to omit menu items that are not authorized to visit.
A menu, or navigation container, is a class implementing the \RecursiveIterator interface. It has a hierarchical structure, with nodes called pages(see the `Page` class) that may have children. It is basically a tree
3
+
A menu, or navigation container, is a class implementing the `RecursiveIterator` interface.
4
+
It has a hierarchical structure, with nodes called pages (see the `Page` class) that may have children. It is basically a tree
4
5
5
-
A Page extends the NavigationContainer class. The NavigationContainer is the top most node which represents the entire menu. The children of this node are Page instances that defines each navigation item.
6
+
A Page extends the NavigationContainer class. The NavigationContainer is the top most node which represents the entire menu.
7
+
The children of this node are Page instances that define each navigation item.
6
8
7
-
A page has a reference to its parent, and can have options and attributes. There are no limitation on what is accepted as options or attributes.
9
+
A page has a reference to its parent and can have options and attributes. There is no limitation on what is accepted as options or attributes.
8
10
9
-
Options can be any piece of information that describes a page. Some predefined options exists, in order for the navigation module to work seamlessly with other dot modules.
11
+
Options can be any piece of information that describes a page.
12
+
Some predefined options exist in order for the navigation module to work seamlessly with other dot modules.
10
13
11
-
Attributes are key value pairs that defines the menu item. They are usually inserted as html attributes when parsing the menu, but of course, this is implementation specific.
14
+
Attributes are key value pairs that define the menu item.
15
+
They are usually inserted as HTML attributes when parsing the menu, but of course, this is implementation-specific.
12
16
13
-
A `NavigationService` class, is the service that handles all defined menu container. It can fetch the container from its provider, check if a page is active or not and get the page's generated URI.
17
+
A `NavigationService` class, is the service that handles all defined menu containers.
18
+
It can fetch the container from its provider, check if a page is active or not, and get the page's generated URI.
Copy file name to clipboardExpand all lines: docs/book/v3/container-providers.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,4 +4,4 @@ Each menu can be created from different sources. The responsibility of creating
4
4
5
5
Each provider must implement the interface `ProviderInterface` and be registered in the ProviderPluginManager.
6
6
7
-
We offer just one provider for now, `ArrayProvider`, that is able to fetch and create a menu container from a php array that is defined in the configuration file.
7
+
We offer just one provider for now, `ArrayProvider`, that is able to fetch and create a menu container from a PHP array that is defined in the configuration file.
Used to render the navigation container in a displayable format. It can render a simple HTML ul list or use a partial template, to render the menu in a template engine.
3
+
Used to render the navigation container in a displayable format.
4
+
It can render a simple HTML unordered list or use a partial template to render the menu in a template engine.
4
5
5
6
The partial method is usually the more flexible one, custom rules can be defined and checked in the template.
6
7
7
-
If you are using Twig, there is already a Twig extension provided in package dot-twigrenderer, that you can use to easily parse the menus inside your templates
8
+
If you are using Twig, there is already a Twig extension provided in package dot-twigrenderer that you can use to easily parse the menus inside your templates
8
9
9
-
When using the partial method, the template will receive as parameters the container, the navigation service and any extra parameters set by the developer.
10
+
When using the partial method, the template will receive as parameters the container, the navigation service, and any extra parameters set by the developer.
10
11
11
-
Navigation containers are referred, when parsed, by their name, as defined in the configuration file.
12
+
Navigation containers are referred to, when parsed, by their name, as defined in the configuration file.
0 commit comments