NavComposer
NavComposer
Created by Nav and used to describe navigations in a fluid way. It is usually passed to
PageHtmlBuilder::navigation() to build the navigation.
Methods summary
Modifier and Type | Method |
---|---|
public | __construct ( NavBranchCriteria navBranchCriteria ) |
public NavComposer | includeParent ( bool parentIncluded = true ) |
public NavComposer | absStartLevel ( int absStartLevelNo = null ) |
public NavComposer | relStartLevel ( int relStartLevel = null ) |
public NavComposer | levels ( int numLevels = null ) |
public NavComposer | openLevels ( mixed numOpenLevels = null ) |
public NavComposer | builder ( mixed navItemBuilder ) |
public UiComponent | build ( HtmlView view , array attrs = null , array ulAttrs = null , array liAttrs = null , array aAttrs = null ) |
Methods in detail
-
__construct
Use Nav to create a NavComposer. Don't call this constructor manually.param
NavBranchCriteria Will be used as base. -
includeParent
Default is false. -
absStartLevel
Specifies the first navigation level absolute to the root page (e.g.Nav::root()->absStartLevel(2)
).
-
relStartLevel
Specifies the first navigation level relative to the base page (e.g.Nav::current()->relStartLevel(-1)
).
-
levels
Restricts the maximum number of navigation levels. -
openLevels
This method is used in combination with NavComposer::levels() and advises the NavComposer to include active and open navigation items even if they are outside of the range defined be NavComposer::levels(). Default is 0param
mixed numOpenLevels num open level or null if active or open navigation items should be included.return
-
builder
Specifies the NavItemBuilder for this navigation. If you want to build a custom navigation, create your own NavItemBuilder that inherits from page\ui\nav\NavItemBuilderAdapter -
build
UiComponent public build ( HtmlView view , array attrs = null , array ulAttrs = null , array liAttrs = null , array aAttrs = null )Usally invoked by PageHtmlBuilder::navigation() to build an UiComponent of the described navigation.