n2n Page Rocket 1 API

page\ui\nav

­Nav­Composer

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

    public __construct ( NavBranchCriteria navBranchCriteria )
    Use Nav to create a NavComposer. Don't call this constructor manually.
    param
    NavBranchCriteria Will be used as base.
  • includeParent

    NavComposer public includeParent ( bool parentIncluded = true )
    Default is false.
    param
    bool parentIncluded
    return
  • absStartLevel

    NavComposer public absStartLevel ( int absStartLevelNo = null )
    Specifies the first navigation level absolute to the root page (e.g. Nav::root()->absStartLevel(2)).
    param
    int absStartLevelNo
    return
  • relStartLevel

    NavComposer public relStartLevel ( int relStartLevel = null )
    Specifies the first navigation level relative to the base page (e.g. Nav::current()->relStartLevel(-1)).
    param
    int relStartLevelNo
    return
  • levels

    NavComposer public levels ( int numLevels = null )
    Restricts the maximum number of navigation levels.
    param
    int numLevels or null for no maximum.
    return
  • openLevels

    NavComposer public openLevels ( mixed numOpenLevels = null )
    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 0
    param
    mixed numOpenLevels num open level or null if active or open navigation items should be included.
    return
  • builder

    NavComposer public builder ( mixed navItemBuilder )
    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
    param
    mixed navItemBuilder object of NavItemBuilder or its lookup id as string.
    return
  • 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.
    param
    array attrs
    array ulAttrs
    array liAttrs
    throws
    return